Skip to content

Latest commit

 

History

History
71 lines (53 loc) · 1.96 KB

wave_04.md

File metadata and controls

71 lines (53 loc) · 1.96 KB

OPTIONAL Wave 4: Enhancements

These really are optional - if you've gotten here and you have time left, that means you're moving speedy fast!

More Inventory Management

All these endpoints should support all 3 query parameters from Wave 3. All fields are sortable.

GET /rentals/overdue

List all customers with overdue videos

Fields to return:

  • video_id
  • title
  • customer_id
  • name
  • postal_code
  • checkout_date
  • due_date

GET /customers/<id>/history

List the videos a customer has checked out in the past. Current rentals should not be included.

URI parameters:

  • id: Customer ID

Fields to return:

  • title
  • checkout_date
  • due_date

GET /videos/<id>/history

List customers that have checked out a copy of the video in the past

URI parameters:

  • id: Video identifier

Fields to return:

  • customer_id
  • name
  • postal_code
  • checkout_date
  • due_date

Enhancements

More Query Parameters

The following 3 optional query parameters:

Name Value Description
sort string Sort objects by this field, in ascending order
count integer Number of responses to return per page
page_num integer Page of responses to return

should additionally be accepted by the following three endpoints:

  • GET /video
  • GET /customers/<id>/history
  • GET /videos/<id>/history

So, for an API endpoint like GET /videos, the following requests should be valid:

  • GET /videos: All videos, sorted by ID
  • GET /videos?sort=name: All customers, sorted by name
  • GET /videos?count=10&page_num=2: Customers 11-20, sorted by ID
  • GET /videos?sort=name&count=10&page_num=2: Customers 11-20, sorted by name

Add your own Wave 04 tests to verify functionality.

CLI

Create a Command Line Interface (CLI) program as a client for the Retro Video Store API.