Commit graph

32 commits

Author SHA1 Message Date
justin
c0adeec663 Revert CTA always-rebuild, keep combined text detection for RMD quality
The always-rebuild approach caused the CTA to disappear when the observer
fired a second time. Reverted to only rebuild on FRN change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 03:31:12 -05:00
justin
31a84b95e3 Fix CTA not including RMD quality issues in remediation list
- Always rebuild CTA when observer fires (removes stale CTA first)
- Check both label and full card text for service detection
- Add dedup guards on service list

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 03:24:08 -05:00
justin
1d564b2fdb RMD quality: recommend refiling when issues found
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 03:20:01 -05:00
justin
6b569b52fe Update CLAUDE.md with complete deployment guide, infrastructure map, and key patterns
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 02:54:44 -05:00
justin
134e84177b Add deploy.sh for git-based deployment
Usage: ./deploy.sh (all) or ./deploy.sh site (single service)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 02:52:45 -05:00
justin
cbfb8d6091 Add engagement authorization, remove price headers from intake pages, fix duplicate emails
- Add clickwrap authorization checkbox to fcc-compliance, state-puc, neca-ocn order pages
- Store engagement_accepted_at/ip/version in compliance_orders (migration 074)
- Add 499-A past-due/multi-year eSign engagement letter generator
- Gate 499-A handler on engagement signature for past-due/multi-year orders
- Remove price/tax/fee headers from all 19 intake pages (post-payment only)
- Fix duplicate confirmation email for compliance_batch orders
- Add USAC past-due fee negotiation research doc

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 02:50:02 -05:00
justin
6171c64b90 Fix 8 bugs: XSS, race condition, null safety, form reset, pricing
1. XSS: error messages use textContent by default, innerHTML only
   for controlled HTML (CORES link) via allowHtml flag
2. XSS: name search errors built with DOM API, not innerHTML
3. Race condition: concurrent FRN lookups cancel prior request
   via AbortController tracking
4. Null safety: DOM element guards with error logging
5. Null safety: check.detail uses || "" fallback, \n → <br>
6. Quote form: auto-resets after 3 seconds on successful submit
7. Pricing: discount uses Math.round(total*15)/100 for cent precision
8. Future-proofing: parseFloat for prices instead of parseInt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 22:34:08 -05:00
justin
4853f67f5e Improve UX: better error messages, validation, and mobile fixes
FCC Compliance Check:
- FRN validation: shows "must be 10 digits" with digit count
- Auto-strips non-digits and pads to 10
- 30-second timeout with friendly message
- "Not found in any FCC database" with link to CORES
- Network error guidance
- FRN display uses overflow-wrap for mobile
- Error box uses innerHTML for clickable links

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 22:25:47 -05:00
justin
6865da2004 Add 499 detail address fallback when CORES returns empty
CORES scraper sometimes returns empty address depending on server IP.
Now falls back to Headquarters Address from the FCC 499 filer detail
page, which is more reliable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 22:07:55 -05:00
justin
783eeeb645 Remove standalone Astro portal page — compliance orders now in Frappe
Compliance orders portal page moved to ERPNext/Frappe at:
portal.performancewest.net/compliance-orders

Includes USAC delegation confirmation via Frappe API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 21:47:48 -05:00
justin
438d3a6e2e Add customer portal orders page + my-orders API
- GET /api/v1/compliance-orders/my-orders?email= returns all orders
  grouped by batch, with USAC delegation status
- /account/orders page shows order history with:
  - Entity name, FRN, batch ID, date, payment status
  - Itemized services with pricing
  - USAC delegation callout with confirmation button
  - Auth-gated (requires login)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 21:27:10 -05:00
justin
86205c309c Replace USAC email instructions with confirmation button + add API endpoint
- Intake email now has "I've completed the delegation →" button
  instead of "reply to this email"
- Button links to order success page with action=usac_delegation
- New API: POST /api/v1/compliance-orders/:id/usac-delegation
  Records confirmation timestamp in intake_data and logs it
- Removed "reply to this email" from intake email

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 21:20:22 -05:00
justin
1a27fd7913 Rework 499-A questions into two-step flow
Step 1: "Did ENTITY provide and bill for telecom services?"
  - Yes → red, filing required for each missed year
  - No → Step 2 follow-up

Step 2: "Does ENTITY plan to provide telecom services going forward?"
  - Yes, keep active → yellow, zero-revenue 499-A filings needed
  - No, cancel → yellow, catch-up filings + USAC cancellation

Fixes: white-on-red button visibility, removes confusing 3-way
choice, uses inline styles for button colors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 20:52:03 -05:00
justin
edf81765ac 499-A question: "provide and bill" instead of just "bill"
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 20:47:42 -05:00
justin
d6780dd9f9 Use entity name in ALL CAPS for compliance questions
RMD: "Does WYOMING FIBER PHONE INC provide any voice services?"
499-A: "Did WYOMING FIBER PHONE INC bill customers for voice or data..."
BDC: "Does WYOMING FIBER PHONE INC provide broadband internet access?"

Also applies entity name to response messages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 20:46:25 -05:00
justin
3d36d20148 Add 499-A qualifying questions and USAC cancellation option
When 499-A shows as past due, asks:
- "Yes — I need to file" → keeps red, notes each year priced separately
- "No — I had no telecom revenue" → yellow, explains zero-revenue
  filings still required for each year with active filer ID
- "I want to cancel my 499 registration" → yellow, explains catch-up
  filings must be completed first, offers to handle cancellation

All options have "Change answer" undo buttons.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 20:41:29 -05:00
justin
298d7643bc Add voice service question to RMD check + hide DC Agent when 499-A unchecked
- RMD "not found" now asks "Do you provide any voice services?" with
  Yes/No buttons. Clicking No turns it green (data-only, not applicable).
  Includes "Change answer" undo button.
- DC Agent checkbox hides and unchecks when Form 499-A is unchecked,
  reappears when 499-A is re-checked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 20:39:18 -05:00
justin
6ec28f6a79 Enable Plaid balance verification for ACH payments
Adds financial_connections with balances permission and prefetch
to Stripe Checkout sessions when payment_method is ACH. This uses
Plaid to verify the customer's bank account balance before accepting
payment, reducing ACH return risk.

- permissions: ["payment_method", "balances"]
- prefetch: ["balances"]
- verification_method: "instant"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 20:31:06 -05:00
justin
75ea2c5c6f Fix 3 bugs: BDC undo, JSON parse safety, price formatting
1. BDC Yes/No buttons now have "Change answer" undo — clicking
   Yes or No is reversible without re-running the check
2. intake_data JSON.parse wrapped in try/catch with error logging
   instead of silently returning empty object
3. All CTA price displays use .toFixed(2) for consistent formatting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 15:13:18 -05:00
justin
a7d7fee154 Fix 6 bugs found in compliance and checkout flows
1. CRITICAL: Add compliance_batch to stripe session tableMap —
   session IDs weren't being stored for batch orders
2. CRITICAL: Fix batch orders using order_number instead of batch_id
   when storing stripe_session_id
3. MAJOR: Tax deductibility note only shows for compliance orders,
   not CRTC/formation/bundles
4. MAJOR: Identity verification fallback changed from localhost:4321
   to performancewest.net with warning log
5. MEDIUM: Fix discount rounding — last service absorbs remainder
   to prevent cent loss across batch orders
6. LOW: Validate at least one paid service in batch orders
7. Standardize support email to info@performancewest.net everywhere

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 09:56:12 -05:00
justin
28d82912f7 Add compliance intake email after payment
Sends next-steps email with services list, USAC delegation
instructions for 499-A, and multi-year catch-up note.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 09:26:26 -05:00
justin
3acdc68994 Update prior-year catch-up messaging
- Explains that each missed year is filed and priced separately
- Tells user we'll contact them for USAC E-File delegation after order
- "Not sure what you need?" leads to the free assessment form

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 08:22:23 -05:00
justin
ea147386b6 Keep search results visible after clicking a result
User can click a different result if they picked the wrong one.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 08:17:58 -05:00
justin
4096c3739e Improve business name search results UI
Results now show as proper clickable cards with:
- Entity name (bold), DBA (if different from legal name)
- FRN (monospace) and Filer ID on the right
- Clear "click to check compliance" hint
- Bordered list with dividers and hover state
- Hides results after selection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 08:15:32 -05:00
justin
04d65eef85 Fix remaining TypeScript syntax in inline script
Arrow function type annotations (c: any) also crash in browsers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 08:06:59 -05:00
justin
6c0b602857 Fix JS crash — remove TypeScript syntax from inline script
The quote form code had TypeScript casts (as HTMLInputElement, as
HTMLButtonElement) in a plain <script> tag. Browsers can't parse
TypeScript — this killed the entire page script silently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 08:04:05 -05:00
justin
aa8ad6d106 Use --no-cache in deploy to prevent stale Docker builds
Docker layer caching was serving old site content after git pull
because file timestamps didn't change enough to bust the cache.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 07:57:14 -05:00
justin
a3028a3b51 Add quote request form to prior-year catch-up section
"Contact us" now opens an inline form that submits a ticket
to ERPNext via POST /api/v1/tickets with category "quote".
Pre-fills entity name, FRN, and overdue items from the check.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 07:50:17 -05:00
justin
7b9c9a48c0 Fix DBA display — other_dba_names is a string, not an array
Spreading a string gives individual characters ("C,a,r,i,e,r...").
Filter as string values instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 07:46:52 -05:00
justin
5016f2e2f3 Fix Get Started button color — use inline style instead of Tailwind
Tailwind purges bg-orange-500 since it's not in the safelist.
Use inline style to guarantee the orange button renders.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 07:43:23 -05:00
justin
0cb9db66ad Add git-based deployment, CLAUDE.md, and .gitignore
- Replace rsync deploy with git pull workflow
- Add CLAUDE.md with deployment rules to prevent file clobbering
- Add .gitignore for node_modules, dist, .env, etc.
- Deploy script now supports: ./deploy.sh prod | ./deploy.sh dev
- Enforces committed changes before deploy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 06:54:54 -05:00
justin
f8cd37ac8c Initial commit — Performance West telecom compliance platform
Includes: API (Express/TypeScript), Astro site, Python workers,
document generators, FCC compliance tools, Canada CRTC formation,
Ansible infrastructure, and deployment scripts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 06:54:22 -05:00