forked from Ada-Developers-Academy/C3Projects--VideoStoreAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocumentation.txt
More file actions
69 lines (65 loc) · 2.51 KB
/
documentation.txt
File metadata and controls
69 lines (65 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
### Customers
GET '/customers'
// => [{<customer>}, {<customer>}] <-- includes customer attributes
- See a list of customers with overdue movies
// ?&status=overdue
- Retrive a subset of customers
- Given a sort column, return _n_ customer records, offset by _p_ records (this will be used to create "pages" of customers)
// ?&n=12&p=2&sort=_____
// sort options: name, registered_at, postal_code
- Sort columns are
- `name`
- `registered_at`
- `postal_code`
GET 'customers/:id/rentals'
- Given a customers `id`...
- List the movies they _currently_ have checked out
+ include rental id
- List the movies a customer has checked out in the past
+ include rental id
- ordered by check out date
- includes return date
### Movies
GET '/movies'
// => [{<movie>}, {<movie>}] <-- includes movie attributes
// OPTIONAL
// ?n=12&p=2&sort=_____
// sort options: title, release_date
- Retrieve a list of all movies
- Retrieve a subset of movies
- Given a sort column, return _n_ movie records, offset by _p_ records (this will be used to create "pages" of movies)
- Sort columns are
- `title`
- `release_date`
GET 'movies/:title/customers'
// => {<movie>} <-- title is REQUIRED TO BE unique
// ?status=____&sort=_____
// status options: current, past
// status required for this endpoint
// sort options: id, name, checkout_date
// sort required for status past
- Given a movies `title`...
+ include rental ids
- Get a list of customers that have _currently_ checked out a copy of the film
- See a list of customers that have _currently_ checked out any of the movie's inventory
- Get a list of customers that have checked out a copy _in the past_
- ordered by customer `id`
- ordered by customer `name`
- ordered by check out date
GET '/movies/:title'
// => {<movie>} <-- title is REQUIRED TO BE unique
- Look a movie up by title to see
- its synopsis
- release date
- and inventory total
- Know if a movie has any inventory available to rent (num avail, num checked out, which/whatever)
### Rental
- Given a customer's `id` and a movie's `title` ...
POST '/rentals'
// in the body, include customer/movie details
- "check out" one of the movies inventory to the customer
- Establish a return date
- Charge the customers account (cost up to you)
PUT '/rentals/:customer_id'
- "check in" one of customers rentals
- return the movie to its inventory