The Booking Form

From tap to walk: the full loop

Everything you've built so far now pays off. In this module you'll follow one booking through its whole life: an owner fills a form β†’ the app POSTs it to the backend β†’ it lands as pending β†’ a walker accepts it, starts the walk, completes it β†’ the new status flows back to the owner's list. Both ends of that loop are Swift you can already read.

Start at the beginning. In Module 9's WalkersView, tapping a walker card sets @State private var bookingWalker: Walker?, and the item sheet from that same module presents the form:

.sheet(item: $bookingWalker) { walker in CreateBookingView(walker: walker, onBooked: onBooked) }

So CreateBookingView receives two things from its presenter: the Walker being booked, and onBooked β€” a closure property of type (Booking) -> Void, the "events flow up" callback pattern from Module 9. The form doesn't know or care who presented it; it just promises to call onBooked with the new booking if the submit succeeds.