Skip to content
Luigi Minardi edited this page Apr 18, 2022 · 2 revisions

Go to Home

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.

Orders Fields

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

Foreign Keys

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.

Endpoints

The default endpoint is <path>:<port>/orders.

Example: http://localhost:3000/orders, path is http://localhost, port is 3000.

Check the CRUD

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.