The MCS-150 biennial update re-confirms the carrier's existing FMCSA record. Previously the PDF filler only had whatever the intake form collected; rescued/sparse orders (or orders where the carrier's data lives in FMCSA, not the intake) produced near-empty forms. Now we pull the carrier census (legal name, address, EIN, fleet counts) from the FMCSA carrier API and merge it under any customer-provided intake values (customer edits win), so the form is pre-filled with the carrier's current registered data. Refactored the FMCSA fetch into a shared _fetch_fmcsa_carrier helper used by both enrichment and status check.
203 lines
10 KiB
Python
203 lines
10 KiB
Python
"""Service handler registry.
|
|
|
|
Maps service slugs (matching ERPNext item codes) to their handler classes.
|
|
"""
|
|
|
|
from .flsa_audit import FLSAAuditHandler
|
|
from .contractor_review import ContractorReviewHandler
|
|
from .handbook_review import HandbookReviewHandler
|
|
from .ccpa_audit import CCPAAuditHandler
|
|
from .privacy_policy import PrivacyPolicyHandler
|
|
from .breach_response import BreachResponseHandler
|
|
from .consent_audit import ConsentAuditHandler
|
|
from .dnc_review import DNCReviewHandler
|
|
from .campaign_review import CampaignReviewHandler
|
|
from .fcc_compliance_checkup import FCCComplianceCheckupHandler
|
|
|
|
# FCC remediation filings (automated Playwright submission to FCC / USAC / BDC)
|
|
from .rmd_filing import RMDFilingHandler
|
|
from .cpni_certification import CPNIFilingHandler
|
|
from .form_499a import Form499AHandler, Form499ABundleHandler
|
|
from .form_499q import Form499QHandler
|
|
from .form_499a_discontinuance import Form499ADiscontinuanceHandler
|
|
from .stir_shaken import StirShakenHandler
|
|
from .bdc_filing import BDCFilingHandler
|
|
from .fcc_full_compliance import FullComplianceHandler
|
|
from .dc_agent import DCAgentHandler
|
|
# NECA OCN / Company Code registration (admin-driven, no Playwright flow)
|
|
from .ocn_registration import OCNRegistrationHandler
|
|
# CDR Traffic Study analysis (rolls ingested CDRs into a 499-A study)
|
|
from .cdr_analysis import CDRAnalysisHandler
|
|
# New FCC onboarding + compliance filings
|
|
from .cores_frn_registration import CORESFRNRegistrationHandler
|
|
from .form_499_initial import Form499InitialHandler
|
|
from .calea_ssi import CALEASSIHandler
|
|
from .foreign_carrier_affiliation import ForeignCarrierAffiliationHandler
|
|
from .cdr_storage_tier import (
|
|
CDRStorageTier1Handler,
|
|
CDRStorageTier2Handler,
|
|
CDRStorageTier3Handler,
|
|
)
|
|
from .new_carrier_bundle import NewCarrierBundleHandler
|
|
# Foreign qualification (Certificate of Authority) across US states
|
|
from .foreign_qualification import ForeignQualificationHandler
|
|
# State PUC/PSC registration across US states
|
|
from .state_puc_filing import StatePucFilingHandler
|
|
# FCC Carrier / ISP Registration pipeline
|
|
from .fcc_carrier_registration import FCCCarrierRegistrationHandler
|
|
# DOT / FMCSA Motor Carrier Services
|
|
from .mcs150_update import MCS150UpdateHandler
|
|
from .dot_drug_alcohol import DrugAlcoholProgramHandler
|
|
from .boc3_filing import BOC3FilingHandler
|
|
# State-level trucking compliance (IRP, IFTA, weight taxes, MCP, etc.)
|
|
from .state_trucking import StateTruckingHandler
|
|
# EIN application + virtual mailbox
|
|
from .ein_application import EINApplicationHandler
|
|
from .mailbox_setup import MailboxSetupHandler
|
|
# Carrier close-out / trucking wrap-up (shutdown) + entity dissolution
|
|
from .carrier_closeout import CarrierCloseoutHandler
|
|
# PHMSA hazmat registration (admin-assisted, 49 CFR Part 107)
|
|
from .hazmat_phmsa import HazmatPHMSAHandler
|
|
# Healthcare / NPI provider compliance (review-staged PECOS/NPPES filings)
|
|
from .npi_provider import (
|
|
NPIRevalidationHandler,
|
|
NPIReactivationHandler,
|
|
NPPESUpdateHandler,
|
|
MedicareEnrollmentHandler,
|
|
OIGSAMScreeningHandler,
|
|
ProviderComplianceBundleHandler,
|
|
)
|
|
|
|
SERVICE_HANDLERS: dict[str, type] = {
|
|
"flsa-audit": FLSAAuditHandler,
|
|
"contractor-classification": ContractorReviewHandler,
|
|
"handbook-review": HandbookReviewHandler,
|
|
"policy-development": HandbookReviewHandler, # same handler, different template
|
|
"ccpa-audit": CCPAAuditHandler,
|
|
"privacy-policy": PrivacyPolicyHandler,
|
|
"data-mapping": CCPAAuditHandler, # similar handler
|
|
"breach-response": BreachResponseHandler,
|
|
"consent-audit": ConsentAuditHandler,
|
|
"dnc-compliance": DNCReviewHandler,
|
|
"campaign-review": CampaignReviewHandler,
|
|
# ── FCC Compliance (diagnostic + remediation) ──────────────────────
|
|
"fcc-compliance-checkup": FCCComplianceCheckupHandler,
|
|
"rmd-filing": RMDFilingHandler,
|
|
"cpni-certification": CPNIFilingHandler,
|
|
"fcc-499a": Form499AHandler,
|
|
"fcc-499a-zero": Form499AHandler, # same handler, zero_revenue flag set from slug
|
|
"fcc-499a-499q": Form499ABundleHandler,
|
|
"fcc-499q": Form499QHandler,
|
|
"fcc-499a-discontinuance": Form499ADiscontinuanceHandler,
|
|
"stir-shaken": StirShakenHandler,
|
|
# BDC triple — same handler, mode auto-resolved from slug
|
|
"bdc-filing": BDCFilingHandler, # legacy alias (both)
|
|
"bdc-broadband": BDCFilingHandler,
|
|
"bdc-voice": BDCFilingHandler,
|
|
"fcc-full-compliance": FullComplianceHandler,
|
|
"dc-agent": DCAgentHandler,
|
|
"ocn-registration": OCNRegistrationHandler,
|
|
"cdr-analysis": CDRAnalysisHandler,
|
|
# ── New FCC onboarding + compliance filings ────────────────────────
|
|
"cores-frn-registration": CORESFRNRegistrationHandler,
|
|
"fcc-499-initial": Form499InitialHandler,
|
|
"calea-ssi": CALEASSIHandler,
|
|
"fcc-63-11-notification": ForeignCarrierAffiliationHandler,
|
|
"new-carrier-bundle": NewCarrierBundleHandler,
|
|
# ── Foreign qualification (Certificate of Authority) ─────────────────
|
|
"foreign-qualification-single": ForeignQualificationHandler,
|
|
"foreign-qualification-multi": ForeignQualificationHandler, # same handler, fans out per-state
|
|
# ── Business name reservation (admin-assisted; files SOS name hold) ──
|
|
"name-reservation-tx": MCS150UpdateHandler, # admin-assisted: file Form 501 via SOSDirect
|
|
"name-reservation-nv": MCS150UpdateHandler, # admin-assisted: file NV reservation via SilverFlume
|
|
# ── State PUC/PSC registration ────────────────────────────────────
|
|
"state-puc": StatePucFilingHandler,
|
|
# ── CDR storage tier add-ons (quota bumps, not filings) ────────────
|
|
"cdr-storage-tier1": CDRStorageTier1Handler,
|
|
"cdr-storage-tier2": CDRStorageTier2Handler,
|
|
"cdr-storage-tier3": CDRStorageTier3Handler,
|
|
# ── DOT / FMCSA Motor Carrier Services ────────────────────────────
|
|
"mcs150-update": MCS150UpdateHandler,
|
|
"boc3-filing": BOC3FilingHandler,
|
|
"ucr-registration": MCS150UpdateHandler, # admin-assisted, same pattern
|
|
"dot-registration": MCS150UpdateHandler, # admin-assisted
|
|
"mc-authority": MCS150UpdateHandler, # admin-assisted
|
|
"dot-drug-alcohol": DrugAlcoholProgramHandler, # instant PDF binder ($149)
|
|
"dot-audit-prep": MCS150UpdateHandler, # admin-assisted (document prep)
|
|
"dot-full-compliance": MCS150UpdateHandler, # fans out to individual services
|
|
"usdot-reactivation": MCS150UpdateHandler, # same FMCSA submission flow
|
|
"emergency-temporary-authority": MCS150UpdateHandler, # ask.fmcsa.dot.gov type 308
|
|
"ein-application": EINApplicationHandler,
|
|
"virtual-mailbox": MailboxSetupHandler,
|
|
"carrier-closeout": CarrierCloseoutHandler, # trucking wrap-up / USDOT shutdown
|
|
"entity-dissolution": CarrierCloseoutHandler, # add-on, same handler (dissolution branch)
|
|
"annual-report-filing": MCS150UpdateHandler, # admin-assisted
|
|
"registered-agent": MCS150UpdateHandler, # admin-assisted (NWRA/CorpTools)
|
|
"entity-reinstatement": MCS150UpdateHandler, # admin-assisted
|
|
"entity-upgrade-bundle": MCS150UpdateHandler, # pipeline orchestrator manages sequence
|
|
# ── State-Level Trucking Compliance ───────────────────────────────
|
|
"irp-registration": StateTruckingHandler,
|
|
"ifta-application": StateTruckingHandler,
|
|
"ifta-quarterly": StateTruckingHandler,
|
|
"or-weight-mile-tax": StateTruckingHandler,
|
|
"ny-hut-registration": StateTruckingHandler,
|
|
"ky-kyu-registration": StateTruckingHandler,
|
|
"nm-weight-distance": StateTruckingHandler,
|
|
"ct-highway-use-fee": StateTruckingHandler,
|
|
"ca-mcp-carb": StateTruckingHandler,
|
|
"state-dot-registration": StateTruckingHandler,
|
|
"intrastate-authority": StateTruckingHandler,
|
|
"osow-permit": StateTruckingHandler,
|
|
"state-trucking-bundle": StateTruckingHandler,
|
|
# ── Hazmat / PHMSA Registration ───────────────────────────────────
|
|
"hazmat-phmsa": HazmatPHMSAHandler,
|
|
# ── State emissions / clean-truck (admin-assisted) ────────────────
|
|
"state-emissions": StateTruckingHandler,
|
|
# ── Healthcare / NPI (review-staged) ──────────────────────────────
|
|
"npi-revalidation": NPIRevalidationHandler,
|
|
"npi-reactivation": NPIReactivationHandler,
|
|
"nppes-update": NPPESUpdateHandler,
|
|
"medicare-enrollment": MedicareEnrollmentHandler,
|
|
"oig-sam-screening": OIGSAMScreeningHandler,
|
|
"provider-compliance-bundle": ProviderComplianceBundleHandler,
|
|
}
|
|
|
|
# Service slugs that operate on a telecom entity — used by job_server.py
|
|
# to decide whether to hydrate the entity row from PostgreSQL before
|
|
# dispatching to the handler.
|
|
FCC_SERVICE_SLUGS: frozenset[str] = frozenset({
|
|
"fcc-compliance-checkup",
|
|
"rmd-filing",
|
|
"cpni-certification",
|
|
"fcc-499a",
|
|
"fcc-499a-zero",
|
|
"fcc-499a-499q",
|
|
"fcc-499q",
|
|
"fcc-499a-discontinuance",
|
|
"stir-shaken",
|
|
"bdc-filing",
|
|
"fcc-full-compliance",
|
|
"dc-agent",
|
|
"ocn-registration",
|
|
"cdr-analysis",
|
|
# BDC triple (already covered by bdc-filing above; add explicit aliases)
|
|
"bdc-broadband",
|
|
"bdc-voice",
|
|
# New FCC filings
|
|
"cores-frn-registration",
|
|
"fcc-499-initial",
|
|
"calea-ssi",
|
|
"fcc-63-11-notification",
|
|
"new-carrier-bundle",
|
|
# CDR storage tiers — operate on a telecom entity's cdr_ingestion_profiles
|
|
"cdr-storage-tier1",
|
|
"cdr-storage-tier2",
|
|
"cdr-storage-tier3",
|
|
# Foreign qualification — may reference a telecom entity
|
|
"foreign-qualification-single",
|
|
"foreign-qualification-multi",
|
|
# State PUC/PSC — may reference a telecom entity
|
|
"state-puc",
|
|
})
|
|
|
|
__all__ = ["SERVICE_HANDLERS", "FCC_SERVICE_SLUGS"]
|