-
Notifications
You must be signed in to change notification settings - Fork 0
Orders
Luigi Minardi edited this page Apr 18, 2022
·
2 revisions
Orders are the orders that the Users had made, in other words, the Movies that the users had bought. You can access them through our API endpoints.
field | field type | field options |
---|---|---|
id |
integer |
!null , auto , f++ , unq , pk
|
price |
integer | |
movieId |
integer |
!null , fk
|
userId |
integer |
!null , fk
|
date |
date | !null |
createdAt |
date |
!null , auto
|
updatedAt |
date |
!null , auto
|
The movieId and the userId are linked to a movie and a user respectively, that means that the movie and the user need to be valid.
The default endpoint is <path>:<port>/orders
.
Example: http://localhost:3000/orders
, path
is http://localhost
, port
is 3000
.
To see the expected response click on the function, you'll be redirected to the page that specifies its behavior.
The path /
is for the default endpoint, whatever after it will be after the default endpoint (/top-rated
=> <path>:<port>/orders/top-rated
)
method | function | path | check |
---|---|---|---|
POST | add new order to db | / | auth |
GET | return all orders from db | / | auth, adm |
GET | return all orders with rating > 6 | /top-rated | auth, adm |
GET | return order with specified pk | /:pk<integer> | auth |
DELETE | delete order by pk | /:pk<integer> | auth |
I didn't added PUT option since I don't think is something that need to be done.