Refactor phase plan
fiscaliacore's initial incarnation was stateful (stored tenant configs + certs + issued e-CFs). We're migrating phase-by-phase to the stateless bridge model. This page tracks where we are.
The canonical plan doc (in the monorepo): docs/stateless-bridge-refactor.md.
Phases
| Phase | Status | Scope |
|---|---|---|
| 0. Plan | ✅ Shipped | Architecture + phased migration committed to the repo. |
| 1. Session auth | ✅ Shipped | POST /api/v1/sessions + DELETE /api/v1/sessions/current, in-memory session cache with 15-min TTL, bearer-auth filter. |
| 2. Stateless ACECF | ✅ Shipped | POST /api/v1/acecf/issue — carries the full business payload, signs with the in-memory session key, no DB row written. |
| 3. Stateless e-CF issuance | 🔶 In progress | POST /api/v1/ecf/issue-stateless shipped behind the dgii.ecf.stateless-issue.enabled feature flag — bearer-session auth, full payload on the request, no DB writes. The legacy tenantId-keyed /api/v1/ecf/issue stays alive for transition; Phase 6 swaps paths + removes the stateful variant. |
| 4. Status proxy + RI generation | 🔶 Pending | GET /api/v1/status/{trackId} proxies DGII's consulta-resultado; POST /api/v1/ri/generate takes signed XML → returns the PDF representación impresa. DgiiStatusPoller is removed. |
| 5. Inbound receiver refactor | 🔶 Pending | {rnc}.ecf.fiscaliacore.com/fe/* stops persisting; routes to an integrator callback URL via a small receiver_registry + HMAC envelope. |
| 6. Drop state tables | 🔶 Pending | Flyway migration drops tenant_ecf_config business columns, ecf_certificates, ecf_sequences, ecf_documents, ecf_document_audit, ecf_receiver_exchange, ecf_contingency_queue, and platform_auth.organization_tenants. |
| 7. Complete fiscaliacore's own DGII cert | 🔶 Pending | Pasos 4–15 on the stateless stack. Paso 2 already complete under the stateful code; Paso 3 in progress through the stateless ACECF endpoint. |
What this means for integrators
If you're starting today: build against the Phase 2 stateless endpoints. That's the target shape — you won't need to refactor when the rest ship.
If you built against the legacy tenantId-keyed endpoints during Pasos 1–2: you have time. Those endpoints stay alive through Phase 3 (and likely longer) behind a Deprecation: header with a sunset date ≥ 60 days out. The integration guide describes the stateless shape you'll migrate to.
What's deliberately not in scope
- A self-service onboarding portal at
platform.fiscaliacore.com. Today this site is docs-only. Signup + API keys + usage dashboards + billing dashboards ship post-Phase-7. During the refactor, integrators onboard by emailinginceptumrex+fiscaliacore@gmail.com. - Per-end-customer account management. End-customers (RNC holders) never sign up with fiscaliacore. They stay inside the integrator's product.
- Invoice storage. We sign + forward; we never keep.