WORKFLOW-APP/lib
Ysterbaard 1fecf02214 Add pre-send validation gate + idempotent sign-back to appointment flow
PB: 3 new fields on ysterbaard_director_appointments
  - proceed_anyway (bool) — true if user proceeded with missing emails
  - missing_emails (text) — comma-separated keys
  - missing_emails_detail (text) — JSON per-recipient validation

App:
  - POST /api/appointments: builds recipient report (initial +
    distro); returns 422 + report if proceed_anyway is missing
    and any recipient is missing/invalid. preview=1 returns the
    report without sending.
  - PATCH /api/appointments/[id]: tightened idempotency guard to
    also short-circuit on signature_received (not just
    mail_sent_to_all). Prevents double-send on double-click.
  - DirectorAppointmentTab: two-step modal — "Validate recipients"
    surfaces the report (status dots + per-recipient email),
    then Send / Proceed anyway / Fix records first. New
    "company_email" gap surfaced before any email leaves.
  - lib/format.ts: isValidEmail() shared helper.

End-to-end tested: 422 enforces server-side, preview returns
the report, double-PATCH signs only once.
2026-08-18 21:29:08 +02:00
..
voice feat: Check Mail button on Step 2 + check-cipc-mail API route 2026-08-11 18:33:03 +02:00
api.ts wip: registration wizard, address splits, document panel, appointments 2026-08-17 18:33:56 +02:00
format.ts Add pre-send validation gate + idempotent sign-back to appointment flow 2026-08-18 21:29:08 +02:00
pb.ts wip: registration wizard, address splits, document panel, appointments 2026-08-17 18:33:56 +02:00
types.ts Add onboarding form fields to companies + directors (visual + editable) 2026-08-18 12:25:06 +02:00
wizard-types.ts wip: registration wizard, address splits, document panel, appointments 2026-08-17 18:33:56 +02:00