| Prompt | make the reserve seating button functional, when you reserve seating I want it to show up under a seats reserved tab or something, when you reserve a seat I want there to be an option to reserve storage space in the same car
What Ai wrote:
In my PHP app "Seat Saver" at /Users/louiseoconnell/Herd/seat-saver, the ride cards on index.php have "Reserve seat" and "Reserve storage" buttons that are currently just non-functional placeholders (<button type="button">, no backend). The reservations table already exists in config/schema.sql (trip_id, passenger_id, wants_seat, small_count, medium_count, large_count, unique per trip+passenger) but nothing uses it yet.
Please make this functional:
- A rider can reserve a seat on a ride. When reserving a seat, also let them optionally reserve storage space in that same car in the same flow, rather than as two separate actions.
- Reserved seats/storage should reduce the ride's remaining open counts (
seats_open/small_open/medium_open/large_open on that trip) so other riders see accurate availability, and a rider shouldn't be able to over-reserve past what's actually open.
- For storage specifically: apply the cascading rule we already decided on for this app — if the exact size a rider wants (e.g. small) is full but a bigger size (medium/large) still has room, let them use that instead of blocking them.
- Add a way for a user to see their own reservations — something like a "My rides"/"Seats reserved" view showing what they've signed up for, with the ability to cancel/withdraw a reservation they no longer need (which should give the seat/storage back to the pool).
Match the existing app's conventions (CSRF protection, prepared statements, session-based auth, the existing card/button/list styling already used elsewhere) — you have freedom on the exact implementation, page names, and function structure, just keep it consistent with how the rest of the app is built.
|
|---|