new-site/docs/order-flow.svg
justin 9c1b1387cb Update docs + add 3 SVG flowcharts
New diagrams:
- business-flow.svg: acquisition → check → order → filing → delivery
- technical-architecture.svg: full Docker stack, data tier, external services
- order-flow.svg: detailed worker pipeline with eSign gate and handler map

Updated docs:
- infrastructure.md: DocServer, email servers, backup server sections
- architecture.md: linked to new SVGs, updated date

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

166 lines
12 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 750" font-family="Inter, system-ui, sans-serif" font-size="10">
<defs>
<marker id="a" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5 Z" fill="#64748b"/>
</marker>
<marker id="ag" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5 Z" fill="#059669"/>
</marker>
<marker id="ar" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5 Z" fill="#dc2626"/>
</marker>
</defs>
<text x="600" y="25" text-anchor="middle" font-size="16" font-weight="700" fill="#1e3a5f">FCC Compliance Order — Processing Flow</text>
<!-- Step 1: Email -->
<rect x="30" y="50" width="150" height="50" rx="8" fill="#dbeafe" stroke="#93c5fd"/>
<text x="105" y="72" text-anchor="middle" font-size="10" font-weight="600" fill="#1e3a5f">Email Campaign</text>
<text x="105" y="85" text-anchor="middle" font-size="8" fill="#64748b">Listmonk → Postfix</text>
<line x1="180" y1="75" x2="210" y2="75" stroke="#64748b" marker-end="url(#a)"/>
<!-- Step 2: Compliance Check -->
<rect x="215" y="50" width="150" height="50" rx="8" fill="#dcfce7" stroke="#86efac"/>
<text x="290" y="72" text-anchor="middle" font-size="10" font-weight="600" fill="#059669">Free Check</text>
<text x="290" y="85" text-anchor="middle" font-size="8" fill="#64748b">?frn= auto-run</text>
<line x1="365" y1="75" x2="395" y2="75" stroke="#64748b" marker-end="url(#a)"/>
<!-- Step 3: Results + CTA -->
<rect x="400" y="50" width="150" height="50" rx="8" fill="#fef3c7" stroke="#fcd34d"/>
<text x="475" y="72" text-anchor="middle" font-size="10" font-weight="600" fill="#92400e">Results + CTA</text>
<text x="475" y="85" text-anchor="middle" font-size="8" fill="#64748b">"Fix N Issues"</text>
<line x1="550" y1="75" x2="580" y2="75" stroke="#64748b" marker-end="url(#a)"/>
<!-- Step 4: Checkout -->
<rect x="585" y="50" width="150" height="50" rx="8" fill="#fef3c7" stroke="#fcd34d"/>
<text x="660" y="72" text-anchor="middle" font-size="10" font-weight="600" fill="#92400e">Stripe Checkout</text>
<text x="660" y="85" text-anchor="middle" font-size="8" fill="#64748b">Card / ACH / PayPal</text>
<line x1="735" y1="75" x2="765" y2="75" stroke="#059669" marker-end="url(#ag)"/>
<text x="750" y="68" font-size="8" fill="#059669" font-weight="600">paid</text>
<!-- Step 5: Order Created -->
<rect x="770" y="50" width="160" height="50" rx="8" fill="#1e3a5f"/>
<text x="850" y="72" text-anchor="middle" font-size="10" font-weight="600" fill="#fff">Order Created</text>
<text x="850" y="85" text-anchor="middle" font-size="8" fill="#94a3b8">PG + ERPNext SO</text>
<!-- Arrow down to worker dispatch -->
<line x1="850" y1="100" x2="850" y2="130" stroke="#64748b" marker-end="url(#a)"/>
<text x="870" y="120" font-size="8" fill="#64748b">dispatch</text>
<!-- ═══ WORKER PROCESSING DETAIL ═══ -->
<rect x="30" y="135" width="1140" height="580" rx="10" fill="#faf5ff" stroke="#c4b5fd" stroke-width="1.5"/>
<text x="600" y="155" text-anchor="middle" font-size="12" font-weight="700" fill="#5b21b6">Worker Processing Pipeline (Python job server)</text>
<!-- Step A: Generate Docs -->
<rect x="50" y="170" width="250" height="80" rx="8" fill="#fff" stroke="#c4b5fd"/>
<text x="175" y="190" text-anchor="middle" font-size="10" font-weight="700" fill="#5b21b6">1. Generate Documents</text>
<text x="60" y="208" font-size="9" fill="#475569">• Template selected by carrier type</text>
<text x="60" y="221" font-size="9" fill="#475569">• DOCX generated (python-docx)</text>
<text x="60" y="234" font-size="9" fill="#475569">• Convert to PDF (Word VM / LibreOffice)</text>
<text x="60" y="245" font-size="8" fill="#94a3b8">_styles.py shared across 26 generators</text>
<line x1="300" y1="210" x2="340" y2="210" stroke="#64748b" marker-end="url(#a)"/>
<!-- Step B: Upload MinIO -->
<rect x="345" y="170" width="180" height="80" rx="8" fill="#fff" stroke="#c4b5fd"/>
<text x="435" y="190" text-anchor="middle" font-size="10" font-weight="700" fill="#5b21b6">2. Upload to MinIO</text>
<text x="355" y="208" font-size="9" fill="#475569">• PDF stored at</text>
<text x="355" y="221" font-size="9" fill="#475569"> compliance/{order}/</text>
<text x="355" y="234" font-size="9" fill="#475569">• Presigned URL for portal</text>
<line x1="525" y1="210" x2="565" y2="210" stroke="#64748b" marker-end="url(#a)"/>
<!-- Step C: eSign Gate -->
<rect x="570" y="170" width="200" height="80" rx="8" fill="#fef2f2" stroke="#fca5a5"/>
<text x="670" y="190" text-anchor="middle" font-size="10" font-weight="700" fill="#dc2626">3. eSign Gate</text>
<text x="580" y="208" font-size="9" fill="#475569">• Insert esign_records row</text>
<text x="580" y="221" font-size="9" fill="#475569">• Email JWT signing link</text>
<text x="580" y="234" font-size="9" fill="#475569">• PAUSE — wait for signature</text>
<text x="580" y="245" font-size="8" fill="#dc2626" font-weight="600">Handler returns [] (no delivery yet)</text>
<!-- Arrow down: client signs -->
<line x1="670" y1="250" x2="670" y2="280" stroke="#dc2626" marker-end="url(#ar)"/>
<text x="690" y="270" font-size="8" fill="#dc2626" font-weight="600">client signs</text>
<!-- Step C2: Signature received -->
<rect x="570" y="285" width="200" height="55" rx="8" fill="#dcfce7" stroke="#86efac"/>
<text x="670" y="305" text-anchor="middle" font-size="10" font-weight="700" fill="#059669">3b. Signature Received</text>
<text x="580" y="322" font-size="9" fill="#475569">esign_completed → re-dispatch</text>
<text x="580" y="335" font-size="9" fill="#475569">handler with client_approved=true</text>
<line x1="770" y1="312" x2="810" y2="312" stroke="#059669" marker-end="url(#ag)"/>
<!-- Step D: Auto-filing check -->
<rect x="815" y="170" width="200" height="80" rx="8" fill="#fff" stroke="#c4b5fd"/>
<text x="915" y="190" text-anchor="middle" font-size="10" font-weight="700" fill="#5b21b6">4. Auto-Filing Check</text>
<text x="825" y="208" font-size="9" fill="#475569">AUTO_FILING_ENABLED=true?</text>
<text x="825" y="228" font-size="9" fill="#059669" font-weight="600">YES → proceed to filing</text>
<text x="825" y="241" font-size="9" fill="#dc2626" font-weight="600">NO → admin review todo</text>
<line x1="915" y1="250" x2="915" y2="280" stroke="#64748b" marker-end="url(#a)"/>
<!-- Step E: File with FCC -->
<rect x="815" y="285" width="200" height="80" rx="8" fill="#fff" stroke="#c4b5fd"/>
<text x="915" y="305" text-anchor="middle" font-size="10" font-weight="700" fill="#5b21b6">5. File with FCC/USAC</text>
<text x="825" y="323" font-size="9" fill="#475569">• Playwright browser automation</text>
<text x="825" y="336" font-size="9" fill="#475569">• ECFS, RMD portal, USAC E-File</text>
<text x="825" y="349" font-size="9" fill="#475569">• Screenshot confirmation capture</text>
<text x="825" y="360" font-size="8" fill="#94a3b8">Failure → Telegram alert + admin todo</text>
<line x1="915" y1="365" x2="915" y2="395" stroke="#64748b" marker-end="url(#a)"/>
<!-- Step F: Record + Deliver -->
<rect x="815" y="400" width="200" height="80" rx="8" fill="#fff" stroke="#c4b5fd"/>
<text x="915" y="420" text-anchor="middle" font-size="10" font-weight="700" fill="#5b21b6">6. Record &amp; Deliver</text>
<text x="825" y="438" font-size="9" fill="#475569">• filing_state recorded in PG</text>
<text x="825" y="451" font-size="9" fill="#475569">• ERPNext SO → "Filed" workflow</text>
<text x="825" y="464" font-size="9" fill="#475569">• Confirmation email to client</text>
<text x="825" y="475" font-size="8" fill="#94a3b8">Compliance Deadline DocType created</text>
<line x1="815" y1="440" x2="540" y2="440" stroke="#64748b" marker-end="url(#a)"/>
<!-- Step G: Client delivery -->
<rect x="340" y="400" width="195" height="80" rx="8" fill="#dcfce7" stroke="#86efac"/>
<text x="437" y="420" text-anchor="middle" font-size="10" font-weight="700" fill="#059669">7. Client Delivery</text>
<text x="350" y="438" font-size="9" fill="#475569">• Documents emailed (PDF)</text>
<text x="350" y="451" font-size="9" fill="#475569">• Confirmation # in email</text>
<text x="350" y="464" font-size="9" fill="#475569">• Portal shows "Filed" status</text>
<text x="350" y="475" font-size="8" fill="#94a3b8">Invoice marked Paid in ERPNext</text>
<line x1="340" y1="440" x2="300" y2="440" stroke="#64748b" marker-end="url(#a)"/>
<!-- Step H: Renewal -->
<rect x="50" y="400" width="245" height="80" rx="8" fill="#dbeafe" stroke="#93c5fd"/>
<text x="172" y="420" text-anchor="middle" font-size="10" font-weight="700" fill="#1e3a5f">8. Renewal Cycle</text>
<text x="60" y="438" font-size="9" fill="#475569">• Compliance Calendar entry created</text>
<text x="60" y="451" font-size="9" fill="#475569">• Reminder emails at 30/14/7 days</text>
<text x="60" y="464" font-size="9" fill="#475569">• Auto-invoice via renewal_worker</text>
<text x="60" y="475" font-size="8" fill="#94a3b8">Annual: RMD Mar 1, CPNI Mar 1, 499-A Oct 1</text>
<!-- ═══ SERVICE HANDLER MAP ═══ -->
<rect x="50" y="500" width="1110" height="90" rx="8" fill="#fff" stroke="#e2e8f0"/>
<text x="605" y="520" text-anchor="middle" font-size="10" font-weight="700" fill="#1e3a5f">Service Handlers (scripts/workers/services/)</text>
<text x="60" y="540" font-size="8" fill="#475569" font-weight="600">Playwright auto-filing:</text>
<text x="60" y="552" font-size="8" fill="#475569">rmd_filing, cpni_certification, form_499a, form_499q, cores_frn_registration, bdc_filing, foreign_carrier_affiliation, form_499_initial</text>
<text x="60" y="570" font-size="8" fill="#475569" font-weight="600">Admin-driven (todo-based):</text>
<text x="60" y="582" font-size="8" fill="#475569">fcc_carrier_registration (8-step), state_puc, ocn_registration, calea_ssi, form_499a_discontinuance, dc_agent, cdr_analysis, canada_crtc (14-step)</text>
<!-- ═══ eSIGN SERVICES ═══ -->
<rect x="50" y="600" width="1110" height="55" rx="8" fill="#fef2f2" stroke="#fca5a5"/>
<text x="605" y="618" text-anchor="middle" font-size="10" font-weight="700" fill="#dc2626">eSign Required Before Filing</text>
<text x="80" y="638" font-size="9" fill="#475569">RMD (perjury 47 CFR § 1.16) | CPNI (officer attestation) | CALEA SSI (plan signature) | 499-A engagement letter | Discontinuance (officer signs deactivation letter)</text>
<text x="80" y="650" font-size="8" fill="#94a3b8">Generic portal: /portal/esign/ | esign_records table | JWT 72h tokens | Draw or type signature | Webhook resumes pipeline</text>
<!-- ═══ DATA FLOW KEY ═══ -->
<rect x="50" y="665" width="1110" height="40" rx="8" fill="#f8fafc" stroke="#e2e8f0"/>
<text x="100" y="685" font-size="9" fill="#374151" font-weight="600">Data stores:</text>
<text x="185" y="685" font-size="8" fill="#475569">PG compliance_orders → ERPNext Sales Order → ERPNext Sales Invoice → ERPNext Payment Entry</text>
<text x="700" y="685" font-size="9" fill="#374151" font-weight="600">Documents:</text>
<text x="778" y="685" font-size="8" fill="#475569">MinIO compliance/{order}/ → eSign portal → Postfix email delivery</text>
<text x="100" y="698" font-size="9" fill="#374151" font-weight="600">Notifications:</text>
<text x="195" y="698" font-size="8" fill="#475569">Telegram (new order + filing failures) | Email (intake, eSign, confirmation, renewal reminders)</text>
<text x="600" y="735" text-anchor="middle" font-size="9" fill="#94a3b8">Performance West Inc. — Updated 2026-05-07</text>
</svg>