Book an appointment
A client books a treatment at a clinic or salon: they pick a service and a free time, enter their details and pay a 20% deposit by card, and go back a step if the slot was taken in the meantime or the card is declined. At 10:00 the day before, a reminder SMS links to Manage booking, where the client can reschedule or cancel. Canceling before the appointment day refunds the deposit; canceling on the day keeps it.
What UJN shows here Point at a note to see its part of the drawing
The source (45 lines)
book-appointment.puml
@startujnrender { direction: down; arrow_spacing: 24 }journey BOOK "Book an appointment"description: "Book a time and pay a deposit. A reminder the day before lets the client reschedule or cancel"unique_id_friendly: booking start from_site { description: "From the booking page" }view slots { title: "Pick a service and time"; description: "Free slots, next 4 weeks"; route: /book }action hold_slot { title: "Hold the slot"; description: "For 10 minutes" }view details { title: "Your details"; description: "Name, phone, email and card"; route: /book/details }action pay_deposit { title: "Charge deposit"; description: "20% of the price" }system psp { type: external; title: "Payment provider"; host: api.pay.example }action confirm { type: message; title: "Send confirmation"; channel: email and SMS }view booked { title: "Booking confirmed"; route: /appointments/:id }end done { type: success; description: "Appointment booked" }action day_before { type: wait; title: "Until the day before"; description: "10:00, the day before the appointment" }action remind { type: message; title: "Reminder SMS"; channel: SMS }handoff reminder_link { title: "Reminder link"; channel: SMS; resume: /appointments/:id/manage }view manage { title: "Manage booking"; description: "Reschedule or cancel"; route: /appointments/:id/manage }ref reschedule { journey: RESCHEDULE; title: "Reschedule"; description: "The deposit moves along" }view cancel_confirm { type: modal; title: "Cancel appointment?"; description: "Says if the deposit is refunded or kept" }end refunded { type: success; description: "Canceled, deposit refunded" }end kept { type: failure; description: "Canceled on the day, deposit kept" } from_site --> slotsslots --> hold_slot : [Pick time] { payload: [service, slot] }hold_slot --> details : still freehold_slot .x.> slots : taken meanwhiledetails --> pay_deposit : [Book and pay] { payload: [name, phone, email, card_token] }pay_deposit -right-> psp { payload: [card_token, deposit] }psp ..> pay_deposit { payload: [payment_id] }pay_deposit --> confirm : paidpay_deposit .x.> details : declinedconfirm --> bookedconfirm --> day_beforebooked --> done : [Done]day_before --> remindremind --> reminder_linkreminder_link ..> manage : [Open link]manage -left-> reschedule : [Reschedule]manage --> cancel_confirm : [Cancel]cancel_confirm ..> manage : [Keep it]cancel_confirm -left-> refunded : [Cancel appointment] before the daycancel_confirm -right-x-> kept : [Cancel appointment] on the day@endujn