Deeman 05b7397687 Refactor waitlist mode with decorator pattern + helper function
Extract duplicated waitlist logic into two reusable abstractions:

1. @waitlist_gate(template, **context) decorator
   - Intercepts GET requests when WAITLIST_MODE=true
   - Passes through POST requests for form handling
   - Evaluates callable context at request time

2. capture_waitlist_email(email, intent, plan, email_intent) helper
   - Idempotent DB insertion (INSERT OR IGNORE)
   - Enqueues confirmation email only for new signups
   - Adds to Resend audience with silent error handling
   - Supports separate email_intent for supplier messaging

Applied to auth, suppliers, and planner routes, reducing ~80+ lines
of duplicated code. Added comprehensive tests (55 total, all passing)
and documentation (25KB guide in docs/WAITLIST.md).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 23:04:21 +01:00
2026-02-11 22:52:06 +01:00
2026-02-19 19:16:23 +01:00
2026-02-16 13:24:42 +01:00
Description
No description provided
32 MiB
Languages
HTML 46.4%
Python 43.3%
JavaScript 4.6%
Jinja 2.3%
CSS 2.2%
Other 1.2%