Client portal: /my-bookings for logged-in clients #13

Closed
opened 2026-07-07 21:57:18 -06:00 by jhodgkin · 1 comment
Owner

Goal

A client-facing portal at /my-bookings where registered clients can see their own booking history, track payment status, and download their signed contracts. Requires #10 and #12.

Access

  • Any user in lisilou-clients (or lisilou-photographers) group can view
  • Session checked via GET /api/auth/me on load; unauthenticated users redirected to Authentik login
  • Clients only ever see their own bookings (filtered by email from OIDC token — never expose other clients data)

Page layout (src/my-bookings.html)

Matches the portfolio color theme. Header shows client name and Logout button.

Active / upcoming bookings

Card layout (not a table — more client-friendly):

  • Session date + time
  • Session type and length
  • Location name
  • Status badge: Pending Payment / Payment Received / Confirmed / Cancelled
  • Payment section:
    • Amount due
    • Venmo payment note they were given (so they can reference it)
    • If pending_confirmation: "We received your payment notification and will confirm shortly"
    • If confirmed: green checkmark + confirmed date
  • Contract section:
    • If signed: Download My Contract button
    • Signed date shown
  • Questions? mailto link to photographer

Past bookings

Collapsed accordion below active bookings. Same card layout, muted styling.

Empty state

If no bookings: friendly message + Book a Session button linking back to the main portfolio.

API endpoints

  • GET /api/client/bookings — returns only bookings where client_email = req.session.user.email
  • GET /api/client/bookings/:id/contract — streams signed PDF only if client_email matches session user

Booking form integration

  • After OIDC login, pre-fill client name and email from session on the booking form (read-only fields)
  • On booking submission, store the Authentik user sub (unique ID) alongside email so the record stays linked even if email changes

nginx

  • /my-bookings → serve src/my-bookings.html
  • /api/client/ → proxy to api service

Acceptance

  • Client logs in and sees only their own bookings
  • Contract PDF downloads correctly and is blocked for other users
  • Pre-filled name/email on booking form matches their Authentik profile
  • Empty state shown correctly for new clients with no bookings
## Goal A client-facing portal at /my-bookings where registered clients can see their own booking history, track payment status, and download their signed contracts. Requires #10 and #12. ## Access - Any user in `lisilou-clients` (or `lisilou-photographers`) group can view - Session checked via GET /api/auth/me on load; unauthenticated users redirected to Authentik login - Clients only ever see their own bookings (filtered by email from OIDC token — never expose other clients data) ## Page layout (`src/my-bookings.html`) Matches the portfolio color theme. Header shows client name and Logout button. ### Active / upcoming bookings Card layout (not a table — more client-friendly): - Session date + time - Session type and length - Location name - Status badge: Pending Payment / Payment Received / Confirmed / Cancelled - Payment section: - Amount due - Venmo payment note they were given (so they can reference it) - If pending_confirmation: "We received your payment notification and will confirm shortly" - If confirmed: green checkmark + confirmed date - Contract section: - If signed: Download My Contract button - Signed date shown - Questions? mailto link to photographer ### Past bookings Collapsed accordion below active bookings. Same card layout, muted styling. ### Empty state If no bookings: friendly message + Book a Session button linking back to the main portfolio. ## API endpoints - `GET /api/client/bookings` — returns only bookings where `client_email = req.session.user.email` - `GET /api/client/bookings/:id/contract` — streams signed PDF only if `client_email` matches session user ## Booking form integration - After OIDC login, pre-fill client name and email from session on the booking form (read-only fields) - On booking submission, store the Authentik user sub (unique ID) alongside email so the record stays linked even if email changes ## nginx - `/my-bookings` → serve `src/my-bookings.html` - `/api/client/` → proxy to api service ## Acceptance - Client logs in and sees only their own bookings - Contract PDF downloads correctly and is blocked for other users - Pre-filled name/email on booking form matches their Authentik profile - Empty state shown correctly for new clients with no bookings
Author
Owner

Confirmed implemented in commit 84fdfdf (2026-07-16, overnight session): GET /api/my-bookings, owner-gated contract download at GET /api/my-bookings/:id/contract, src/my-bookings.html, nginx route. Closing — found this while picking up work from a separate session and reconciling repo state.

Confirmed implemented in commit 84fdfdf (2026-07-16, overnight session): GET /api/my-bookings, owner-gated contract download at GET /api/my-bookings/:id/contract, src/my-bookings.html, nginx route. Closing — found this while picking up work from a separate session and reconciling repo state.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jhodgkin/lisilou-portfolio#13