new-site/api/src
justin d4c4ae003e Fix 6 bugs from code review
Critical:
- Single-order discount used wrong column names (discount_pct/discount_flat_cents
  → discount_type/discount_value). Discounts were silently $0.
- Single-order discount skipped allowed_emails and expires_at checks
- Free orders now set paid_at = NOW()

High:
- Discount usage now tracked in discount_usage table + current_uses incremented
- Flat discount only replaces bundle when flat >= bundle (was always replacing)

Minor:
- Removed unused CDR profile fetch in EntityStep

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-22 02:16:38 -05:00
..
lib Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
middleware Add PUT to CORS allowed methods (needed for intake save) 2026-04-28 18:29:00 -05:00
routes Fix 6 bugs from code review 2026-05-22 02:16:38 -05:00
config.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
create-admin.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
db.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
email.ts Fix 6 bugs found in compliance and checkout flows 2026-04-27 09:56:12 -05:00
erpnext-client.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
fx.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
index.ts Add generic eSign portal for all compliance document types 2026-05-04 10:45:37 -05:00
sanctions.ts Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00