Commit graph

477 commits

Author SHA1 Message Date
justin
479f3dfc45 add entity upgrade bundle service + deploy completion/IMAP crons
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 22:12:11 -05:00
justin
6c75a27893 add vehicle buy/sell referral topics: ByeTruck, Kelly, Big Rig Lending, Truck Trader 2026-05-30 21:37:08 -05:00
justin
ad3d189b2b post-completion flow: survey, referral program, review ask
- Migration 081: referral_codes, referral_uses, exit_surveys tables
- API: POST /api/v1/survey, POST /api/v1/referral/check, GET /api/v1/referral/:email
- Worker: completion_emails.py — sends completion + 24h follow-up (survey + referral)
- Survey page: /survey/?order=X&rating=N — star rating, feedback, Google review ask
- Referral: REF-FIRSTNAME codes, $25 credit per referred order, no limit
- Low ratings (1-3 stars) trigger Telegram alert for admin follow-up
- Cron: every 15 minutes
2026-05-30 21:22:14 -05:00
justin
6b20ba7f08 add post-completion flow: exit survey, Google review ask, referral program spec 2026-05-30 21:17:01 -05:00
justin
4cde6bbb4a add financing/factoring interest checkbox on success page + campaign topics 16-17
- Checkbox on post-order success page: 'Interested in freight factoring?'
- Stores lead via /api/v1/insurance-leads with source=financing_interest
- Added factoring + fuel card campaign topics to docs
2026-05-30 21:15:25 -05:00
justin
0c9a500fee correct campaign topic #1: MC numbers NOT eliminated yet, still proposed 2026-05-30 21:12:31 -05:00
justin
91501f78cd add 15 trucking campaign topics with priority matrix — sourced from forums + FMCSA changes 2026-05-30 21:11:18 -05:00
justin
08e80e11f9 add POST /api/v1/dot/name-check: parallel SOS + FMCSA name availability check
- Checks state SOS for entity name availability (via workers adapter)
- Checks FMCSA census for exact + fuzzy name matches
- Returns: sos_available, fmcsa_in_use, fmcsa_matches, combined 'available' flag
- 20s timeout on SOS lookup, FMCSA query is instant (local DB)
2026-05-30 21:02:32 -05:00
justin
340a364d8c add insurance + state compliance upsells to success page for trucking orders
- Insurance lead capture: pre-filled name/email from order, submits to /api/v1/insurance-leads
- State compliance CTA: shown for new carrier orders, links to DOT compliance page
- Only shown for trucking/DOT order slugs
2026-05-30 20:57:30 -05:00
justin
29ff57694e add new carrier order page with Klarna 4-payments option
/order/trucking-new-carrier/ — for new trucking businesses without a DOT:
- New Carrier Starter Bundle 99 (LLC + USDOT + MC Auth + BOC-3 + MCS-150 + D&A)
- Individual service cards with bundle auto-toggle
- Klarna 4 payments, Card, PayPal, ACH
- No DOT pre-fill (new carriers)
2026-05-30 20:54:35 -05:00
justin
c7251b8aac Klarna: say '4 payments' instead of 'Pay Later' 2026-05-30 20:50:44 -05:00
justin
095838a015 add Klarna Pay Later option to DOT compliance order page 2026-05-30 20:50:20 -05:00
justin
58aa2cf78e map all FMCSA status codes to services: OOS→ETA ($499), Inactive→reactivation, Revoked/Suspended→reinstatement
- OOS (Out of Service): RED, urgent messaging, maps to Emergency Temporary Authority $499
- Inactive: YELLOW, reactivation $149
- Not Authorized: YELLOW, new USDOT + MC authority
- Revoked: RED, new authority application
- Suspended: YELLOW, compliance resolution + reinstatement
- Cancelled: YELLOW, new registration
- Each status has specific actionable messaging with PW CTA
2026-05-30 20:48:47 -05:00
justin
b106a88e90 add USDOT reactivation service ($149) + map inactive status to reactivation CTA
- New service: usdot-reactivation — filed via ask.fmcsa.dot.gov (sub-cat 302)
- Inactive carriers see 'PW can handle reactivation, no Login.gov needed'
- Compliance checker maps inactive operating status to reactivation service
2026-05-30 20:40:56 -05:00
justin
2b8e2cf7ea fix: inactive carriers show yellow warning instead of green, even if FMCSA says 'allowed' 2026-05-30 20:39:28 -05:00
justin
18fb45dba0 fix operating status: translate FMCSA status codes to human-readable labels (A=Active, I=Inactive, etc) 2026-05-30 20:38:22 -05:00
justin
4345a7546d yellow CTA: list specific state/entity items needing attention instead of generic message 2026-05-30 20:36:24 -05:00
justin
2b67420624 fix disclaimer: we ARE a compliance firm, only disclaim legal advice 2026-05-30 20:35:20 -05:00
justin
6dd2fc6e56 add disclaimer + recent update notice to DOT compliance check results 2026-05-30 20:33:10 -05:00
justin
efbf849b54 fix: recommendedServices undefined in yellow-only CTA (caused 'length' error on DOTs with 0 red issues) 2026-05-30 20:29:37 -05:00
justin
ed45265793 add null guard in renderResults to prevent 'cannot read length' error 2026-05-30 20:23:10 -05:00
justin
77c3e8e3e3 add progress steps to DOT compliance checker loading state
Shows animated step-by-step progress instead of generic spinner:
- Looking up FMCSA registration...
- Checking safety record...
- Verifying insurance filings...
- Reviewing operating authority...
- Checking state requirements...
- Verifying business entity status...
Each step gets a green checkmark as it 'completes'
2026-05-30 20:19:20 -05:00
justin
d51a2f61b4 fix Iowa: remove wrong Socrata dataset (was liquor stores), mark SOS as WAF-blocked 2026-05-30 19:28:41 -05:00
justin
a6c7d2aef8 increase SOS lookup timeout to 20s for slower state portals 2026-05-30 19:23:41 -05:00
justin
e8a98b1130 corporate check: live SOS lookup via state adapters for all 51 states
- Formal entities: queries workers /entity-status endpoint for real-time
  Secretary of State status (ACTIVE/dissolved/revoked/delinquent)
- Green if active, red if not active, yellow if not found or lookup failed
- Sole proprietors: yellow 'form an LLC' upsell
- 12s timeout so compliance check doesn't hang on slow state portals
2026-05-30 19:21:06 -05:00
justin
e2313bcc5e add blur detection + Ollama ID validation + corporate check for all carriers
- Client-side: Laplacian variance blur detection in photo quality check
  (very blurry / somewhat blurry / acceptable / good)
- Server-side: async Ollama vision model validates uploaded image is a
  real government ID (minicpm-v:8b), flags non-ID uploads
- Corporate check: sole proprietors now get yellow 'form an LLC' upsell,
  formal entities get annual report/RA reminder
2026-05-30 19:17:31 -05:00
justin
e40f359693 fix photo upload: add synchronous /jobs/presign and /jobs/minio-upload endpoints to workers 2026-05-30 19:13:51 -05:00
justin
ca7af40ceb update photo ID instructions: suggest QR code first for desktop users 2026-05-30 19:07:13 -05:00
justin
592b9875da fix TS build: use rawDot not dotNumber in pending filing query 2026-05-30 19:03:15 -05:00
justin
ffc5a16b5c add corporate compliance check (#15) to DOT checker + annual report/RA/reinstatement services
- Check 15: detects LLC/Inc/Corp/LTD/LP in entity name, shows yellow warning
  about annual reports, franchise tax, and registered agent requirements
- New services: annual-report-filing (49), registered-agent (9/yr),
  entity-reinstatement (99)
- Upsell opportunity: 1.31M formal entities in FMCSA database
2026-05-30 19:02:37 -05:00
justin
a3a546abff add FMCSA confirmation email monitor: IMAP watcher links confirmations to orders, Telegram notify 2026-05-30 19:01:42 -05:00
justin
b90d443667 add submit_filing(): 3x web retry then fax fallback, fix success detection, shared attestation helper 2026-05-30 18:58:14 -05:00
justin
4a4bbd048e fix FMCSA form: wait for lvl2 dropdown, update selectors 2026-05-30 18:54:34 -05:00
justin
99a53ad970 add FMCSA web submitter: Playwright automation for ask.fmcsa.dot.gov ticket form 2026-05-30 18:47:48 -05:00
justin
1f1113d63c add fax filing pipeline: VitalPBX sender, attestation cover page with digital signature, compliance checker pending filing override
- filing_attestation.py: generates cover page attesting PW submitted document
  to recipient with date/time stamp, contact info, and digital signature
- fax_sender.py: sends PDFs via VitalPBX API, polls for delivery, generates
  attested copy for customer records
- dot-lookup.ts: if DOT has pending MCS-150 order, show green 'UPDATE SUBMITTED'
  instead of red 'OVERDUE' in compliance checker
- requirements.txt: add pyhanko + cryptography for PDF digital signatures
2026-05-30 18:32:01 -05:00
justin
e2c7cc582b increase font sizes in photo ID section for readability (min 14px) 2026-05-30 18:15:22 -05:00
justin
e0fc4810d1 show proper error on phone when photo ID upload fails to MinIO 2026-05-30 18:13:18 -05:00
justin
7ef509c247 fix photo ID upload: use workers for MinIO storage + public presigned URLs
- id-upload.ts: replace broken direct minio import with workers presign/upload
- job_server.py: add minio-upload handler for API to store files via workers
- rewrite presigned URLs from internal minio:9000 to public minio.performancewest.net
- fixes: thumbnail not showing after phone upload, base64 fallback storage
2026-05-30 18:12:06 -05:00
justin
f60c5229ab Fix mobile photo upload: resize large camera images + increase body limit
Mobile cameras produce 8-12MB photos. Now:
- Canvas-based resize to max 2000x1500 before upload
- JPEG compression at 0.7-0.85 quality
- Express body limit increased to 5MB for id-upload route
- Falls back to raw upload for small images and PDFs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 17:24:16 -05:00
justin
04861ccfe0 Fix QR code: add inline script right at image element for immediate generation
Previous approach relied on the main is:inline script block which
could be blocked by FCC step crashes. New approach: tiny self-contained
script right next to the QR img element, runs immediately, fetches
upload token and generates QR. Falls back to page URL on failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 17:20:04 -05:00
justin
6b874ea72b Add ts-nocheck to id-upload.ts (minio optional dep)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 16:42:41 -05:00
justin
0ba8730487 Add Telegram notifications for tickets, quotes, and insurance leads
Tickets: 📩 for support, 🏥 for insurance leads, 💰 for quotes
Quotes: 💰 with name, email, company, service, details
All fire-and-forget to Telegram bot — non-blocking.

Previously these only went to ERPNext with no real-time alert.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 16:35:11 -05:00
justin
66bd1306e3 Accept TIFF images for photo ID upload (scanner default format)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 16:28:22 -05:00
justin
d2f9e642d4 Hide QR code on mobile phones, auto-trigger camera on mobile
QR code hidden via CSS on screens < 640px (phones). On mobile,
file input gets capture=environment so tapping the button opens
the camera directly. Tablets still show QR code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 16:25:52 -05:00
justin
1535acb413 Complete phone-to-desktop photo ID upload pipeline
- API: POST /api/v1/id-upload/token generates upload token
- API: POST /api/v1/id-upload/:token receives base64 image, stores in MinIO
- API: GET /api/v1/id-upload/:token/status returns upload status + thumbnail
- Mobile page: sends image as base64 with upload_token
- Desktop intake: requests token, generates QR with upload URL, polls
  every 3s for phone upload, auto-shows thumbnail when detected
- MinIO storage with presigned URLs for thumbnails
- Compliance order intake_data updated with photo_id_uploaded flag

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 16:24:35 -05:00
justin
1611b67543 Add mobile photo ID upload page at /portal/upload-id/
Dedicated mobile-friendly page for phone camera ID capture:
- Big "Take Photo of ID" button with camera capture
- Image preview with basic quality check
- Submit uploads to API with JWT auth
- Success/error states with retry
- QR code on desktop intake links here instead of full form

Still needs: API upload endpoint, polling from desktop, OCR validation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 16:20:27 -05:00
justin
daf6d1f831 Always show QR code for phone photo upload — no click to reveal
QR code displayed inline below the upload button so truckers can
immediately scan with their phone to take a photo of their ID.
Clear instructions: 'Scan with your phone camera to take a photo'

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 16:17:17 -05:00
justin
73a10d4a0f Simplify photo ID upload: clear instructions for truckers
- Yellow instruction box explains 3 methods in plain English
  (phone photo, computer upload, scanner)
- One big orange "Add Photo of Your ID" button
- Webcam + QR code kept in code but simplified UI
- Accepted formats note

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 16:11:49 -05:00
justin
3423b4914a Relabel photo ID buttons: Upload File/Scan + Use Webcam + scanner instructions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 16:09:47 -05:00
justin
39fb1c9998 Webcam capture for photo ID via getUserMedia
Desktop users can now use their webcam to photograph their ID:
- Click "Use Camera" → browser requests webcam permission
- Live video preview with orange guide rectangle for ID placement
- Capture button takes high-res JPEG (1280x720)
- Cancel button stops webcam and returns to upload options
- Captured image goes through same quality check flow
- Works on Chrome, Firefox, Edge, Safari (desktop + mobile)
- No libraries needed — native WebRTC API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-30 16:09:02 -05:00