Creating a booking

The record everything else hangs off

PawWalk sells one thing: a walk. A booking is the record of one β€” this user hired this walker, at this time, for this price. Payments, GPS tracking, the chat thread β€” every other feature points back at a booking row. So POST /bookings is the most important write in the backend, and it's the one where getting it wrong costs real money.

The request carries walkerId, userId, and a scheduledAt timestamp. But two fields are not the client's to send: the priceCents and the status. The server owns those. Trust a client-sent price and a walker posts priceCents: 1 for a free hour; trust a client-sent status and a booking is confirmed before anyone paid.

The senior instinct, same as module 06's DTO lesson: the client says who and when; the server decides how much and what state. Money and state are server-owned, always.