Skip to content

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

PhaseStatusScope
0. Plan✅ ShippedArchitecture + phased migration committed to the repo.
1. Session auth✅ ShippedPOST /api/v1/sessions + DELETE /api/v1/sessions/current, in-memory session cache with 15-min TTL, bearer-auth filter.
2. Stateless ACECF✅ ShippedPOST /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 progressPOST /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🔶 PendingGET /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🔶 PendingFlyway 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🔶 PendingPasos 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 emailing inceptumrex+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.