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>
This commit is contained in:
commit
f8cd37ac8c
1823 changed files with 145167 additions and 0 deletions
60
scripts/workers/icc_adapters/__init__.py
Normal file
60
scripts/workers/icc_adapters/__init__.py
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
"""Inter-Carrier Compensation (ICC) revenue adapters.
|
||||
|
||||
Each adapter parses one carrier-specific interconnection or settlement
|
||||
artifact format into a normalized ``IccRevenueLine`` stream consumed by
|
||||
``scripts.workers.icc_ingester``.
|
||||
|
||||
Dispatch is driven by ``icc_ingestion_uploads.source_format`` (the CHECK
|
||||
constraint on that column enumerates the supported slugs; this module's
|
||||
``ADAPTERS`` dict keys must stay in sync).
|
||||
|
||||
Contract — see ``common.py``:
|
||||
BaseICCAdapter.iter_rows(local_path) -> Iterator[IccRevenueLine]
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Dict, Optional, Type
|
||||
|
||||
from .common import BaseICCAdapter, IccRevenueLine, ValidationError
|
||||
from .cabs_bos_adapter import CABSBOSAdapter
|
||||
from .edi_810_adapter import EDI810Adapter
|
||||
from .iconectiv_8yy_adapter import IconectivQRYAdapter
|
||||
from .international_settlement import InternationalSettlementAdapter
|
||||
from .wholesale_sip_csv import WholesaleSIPCSVAdapter
|
||||
from .carrier_invoice_pdf import CarrierInvoicePDFAdapter
|
||||
|
||||
|
||||
ADAPTERS: Dict[str, Type[BaseICCAdapter]] = {
|
||||
"cabs_bos": CABSBOSAdapter,
|
||||
"edi_810": EDI810Adapter,
|
||||
"8yy_qry": IconectivQRYAdapter,
|
||||
"itu_tas": InternationalSettlementAdapter,
|
||||
"icss": InternationalSettlementAdapter,
|
||||
"wholesale_sip_csv": WholesaleSIPCSVAdapter,
|
||||
"carrier_invoice_pdf": CarrierInvoicePDFAdapter,
|
||||
}
|
||||
|
||||
|
||||
def get_adapter(source_format: str) -> Optional[Type[BaseICCAdapter]]:
|
||||
"""Resolve an ``icc_ingestion_uploads.source_format`` slug into its adapter class.
|
||||
|
||||
Returns ``None`` when the slug is unknown; callers should mark the
|
||||
upload ``failed`` with an explanatory error in that case.
|
||||
"""
|
||||
return ADAPTERS.get(source_format)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"ADAPTERS",
|
||||
"get_adapter",
|
||||
"BaseICCAdapter",
|
||||
"IccRevenueLine",
|
||||
"ValidationError",
|
||||
"CABSBOSAdapter",
|
||||
"EDI810Adapter",
|
||||
"IconectivQRYAdapter",
|
||||
"InternationalSettlementAdapter",
|
||||
"WholesaleSIPCSVAdapter",
|
||||
"CarrierInvoicePDFAdapter",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue