new-site/api
justin 53857574d3 Add referral/discount code to FCC carrier page + REF-JAYK05 agent
Frontend (order/fcc-carrier-registration):
- Add a referral/discount code box on the review step that validates
  against /api/v1/discount/:code and shows the discount line + adjusted
  total. Discount applies to service fee + add-ons, never state filing fees.
- Prefill + auto-apply from ?code= / ?ref= query param (referral links).

Backend (fcc-carrier-registration route):
- Accept discount_code, validate it, store discount_code/discount_cents,
  and subtract from the total. Checkout already reads discount_cents to
  apply the Stripe coupon.
- Create a pending commission when the code belongs to an active sales agent.

Commission fix (agents.createCommission):
- Percent-type agents now earn commission_pct on ALL order types. Previously
  canada_crtc/formation/bundle used flat defaults and ignored percent agents.

Agent: created sales agent Jay Kordic (The Horizon Group) with custom code
REF-JAYK05 -> client gets 5% off discountable services, agent earns 15%.
Idempotent setup script in scripts/create_agent_jaykordic.cjs.
2026-06-02 14:31:22 -05:00
..
migrations migration 083: use CREATE INDEX CONCURRENTLY to avoid locking fmcsa_carriers 2026-05-31 10:42:47 -05:00
src Add referral/discount code to FCC carrier page + REF-JAYK05 agent 2026-06-02 14:31:22 -05:00
Dockerfile Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
package-lock.json Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
package.json Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
start-dev.sh Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
tsconfig.json Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00