WORKFLOW-APP/app/api
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
..
appointments Add pre-send validation gate + idempotent sign-back to appointment flow 2026-08-18 21:29:08 +02:00
bizportal/search feat: Check Mail button on Step 2 + check-cipc-mail API route 2026-08-11 18:33:03 +02:00
bizportal-2 feat: BizPortal 2.0 — Python Playwright sidecar 2026-08-17 18:33:36 +02:00
companies/list wip: registration wizard, address splits, document panel, appointments 2026-08-17 18:33:56 +02:00
directors/list wip: registration wizard, address splits, document panel, appointments 2026-08-17 18:33:56 +02:00
documents wip: registration wizard, address splits, document panel, appointments 2026-08-17 18:33:56 +02:00
onboarding feat: split company physical and postal addresses into structured fields 2026-08-14 21:00:14 +02:00
pb/records feat: Check Mail button on Step 2 + check-cipc-mail API route 2026-08-11 18:33:03 +02:00
register wip: registration wizard, address splits, document panel, appointments 2026-08-17 18:33:56 +02:00
tasks fix: handle unknown/empty task statuses without crashing 2026-08-17 19:00:42 +02:00