Acceptance Criteria
- Users are able to submit contracts and payments to the API
[GET] /api/contracts/<id>
[POST]/api/payments/<contract_id>
- Users are able to retrieve contracts and payments that they submitted
[GET] /api/contracts/
- Users are able to retrieve the amount due for each contract they have
- Amount due is how much they still have to pay for a contract
- You must consider the interest rate and all payments made
[GET] /api/contracts/
Property: amount_due
- Users cannot see contracts/payments submitted by other users
done
- Use of the API requires a unique auth token for each user
[Header] Authorization: Token <token_here>
It can be generated through admin
- Submitted contracts must include, at least, the following attributes:
- Identifier - an autogenerated random identifier for the contract
- Amount - the amount owed to the bank
- Interest rate - the monthly interest rate of the contract
- IP Address - IP of the contract submitter
- Submission date - the date the contract was submitted
- Bank - information about the bank for which the money is owed, can be simple text (e.g., name, tax id, etc.) or a separate model altogether
- Customer Metadata - information about the individual that owes the money, can be simple text (e.g., name, email, tax id, etc.) or a separate model altogether
done
- Submitted payments must include, at least, the following attributes:
- Contract identifier
- Payment date
- Payment amount
done
Optional:
- Provide an authenticated admin view that allows me to view all contracts
/admin
- Document the API
/api/docs
- Expand the financial model to include taxes/insurance and other costs
nope
There is a command called increase_amount_due acessible via:
python manage.py increase_amount_due.py
(contracts/management/commands).
It should be called daily basis (cron) to verify all the contracts with due date on this day and increase the value of amount_due
It should be created at admin panel (/admin url)
Available on current sqlite database: admin / admin1234
Available at src/requirements.txt Python version 3.7