In plain terms: a customer taps a heart on the services they book most often,
and those services jump to a “Your Favourites” section at the top next time —
so a regular can re-book their usual two or three services in seconds.
Problem
Repeat customers at Royal Glow typically book the same 2–4 services every visit. Currently, they must scroll through all services each time. This adds unnecessary friction to the booking flow.Solution
Add a heart icon on every service card. Tapping toggles the favourite state. On subsequent bookings, favourited services are shown in a “Your Favourites” section above the regular service list in Step 3 of the booking dialog.Database Schema
- Composite primary key prevents duplicate favourites
- CASCADE delete: if user or service is deleted, favourites are cleaned up
created_atallows future sorting by “most recently favourited”- No limit on favourites — with 20–40 services, no practical reason to limit
API Endpoints
- GET
- POST
- DELETE
GET /api/favourites — list the signed-in user’s favourites.- Auth: Required (customer+)
- Response:
{ success: true, data: { favourites: string[] } }(array of service IDs)
UI Implementation
Heart Icon Component
Booking Dialog Step 3 — Service Ordering
Data Flow
Edge Cases
User not signed in
User not signed in
The heart icon is hidden — favourites require auth.
Service deactivated after being favourited
Service deactivated after being favourited
CASCADE delete removes it; inactive services are also filtered out client-side.
User has 0 favourites
User has 0 favourites
The “Your Favourites” section is not shown.
Network error on toggle
Network error on toggle
The optimistic state is reverted and an error toast is shown.
Same service favourited from /services and the booking dialog
Same service favourited from /services and the booking dialog
Same API, same DB row — no conflict.
Accessibility
aria-label="Add to favourites"/"Remove from favourites"on the heart buttonaria-pressed="true/false"for toggle state- Keyboard: Enter/Space toggles
- Visible focus ring on tab navigation
- Colour is not the only indicator (filled vs outline shape)
Analytics Events
Where It Appears
Implementation Priority
- Phase 1 (Launch)
- Phase 2 (Post-launch)
- DB table + migration
- 3 API endpoints (GET, POST, DELETE)
- Heart icon on booking dialog Step 3
- “Your Favourites” section ordering in booking
