SJBroida / Capstone_Restaurant_Reservation_System

GitHub Repository for the final Thinkful capstone: a complete Restaurant Reservation System application
1 stars 0 forks source link

US-03 Create reservation within eligible timeframe #3

Open SJBroida opened 2 years ago

SJBroida commented 2 years ago

User Story 3:

As a restaurant manager I only want to allow reservations to be created during business hours, up to 60 minutes before closing so that users do not accidentally create a reservation for a time we cannot accommodate.

SJBroida commented 2 years ago

Acceptance criteria

  1. The /reservations/new page will display an error message with className="alert alert-danger", if any of the following additional constraints are violated:
    • The reservation time is before 10:30 AM.
    • The reservation time is after 9:30 PM, because the restaurant closes at 10:30 PM and the customer needs to have time to enjoy their meal.
    • The reservation date and time combination is in the past. Only future reservations are allowed. E.g., if it is noon, only allow reservations starting after noon today.
  2. The /reservations API will have the same validations as above and will return 400, along with an informative error message, when a validation error happens.
SJBroida commented 2 years ago

Hint Parsing a Date that includes the time in JavaScript can be tricky. Again, keep an eye out for which time zone is being used for your Dates.