-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Here we will be defining the new routes we'll work towards. This document will serve for feedback, documentation and a TODO list.
We will only create what is necessary and try to follow REST conventions as closely as possible.
We want to minimize the calls frontend needs to make
For example in the previous design addresses was a seperate route. It would be preferable to have this included in other routes.
This way the end-user doesn't need to call addresses seperately. This also simplifies protecting routes.
Complete and fully functional:
- POST
/login- Seperate query for login information
- POST
/logout - POST
/token- Refactor for multiple roles
- GET
/users/self
Contains everything of a user except the password.
For example addresses is also inside the user, no extra request.
DELETE will never be a method. Deactivating the user might be prefered.
Should be complete:
GET/POST/PUT:
-
/employees -
/employees/:user_id
Contains base of user information + employee specific information.
Should be complete:
- GET
/customers - GET
/customers/:user_id - POST
/customers
Contains base of user information + customer specific information.
- GET
/suppliers - GET
/suppliers/:user_id - POST
/suppliers - PUT
/suppliers
No delete! -> front-end disable user instead
- GET
/contracts - GET
/contracts/:user_id - GET
/contracts/self -
POSTestimations creates a contract/contracts
Will contain user_id and address_id as well.
Gets activated when the first meter value submission gets made by an employee.
-> No PUT or PATCH needed, will be done in function
- Adjust status with function
In need of clarification:
GET/POST:
- GET
/consumptions/:user_id- Get all consumptions and meters of a user
- POST
/consumptions/:user_id- Used to manual meter readings
- (optional) GET
/consumptions/self- Used to generate personal usage graphs
Consumptions don't need to be updated, maybe no PUT? Or just delete and new post?
- POST
/estimations
To be tested (no invoices in db yet)
-
GET
/invoices -
GET
/invoices/self -
GET
/invoices/:invoice_id/download -
invoices/:invoice_id- Unnecessary GET -> already inside /invoices
- We are only allowed to update the invoice if it has not yet been sent yet from a legal perspective.
- For sake of simplicity we will not allow this at all.
- No POST -> gets created inside API every month and year
-
-> Move to front-endinvoices/:invoice_id/download -
-> Move filter to front-end (or query filter)/overdue
- GET
/plannings - PATCH
/plannings/:planning_id - Function to automatically make planning
- When contract gets made
- When contract is gonna end
- GET
/cities