feat(pos/facturapi): finalize Horux-to-Facturapi migration

- Normalize Facturapi key/org_id resolution (supports both cfdi_ prefixed
  tenant_config keys and short names used by invoicing_bp).
- Add CSD upload end-to-end (backend + frontend).
- Add helper scripts: setup_facturapi_orgs.py and check_facturapi_tenants.py.
- Add 20 unit tests with mocks (pos/tests/test_facturapi_service.py).
- Add CI workflow for lint + console tests on Python 3.11/3.13.
- Add pyproject.toml and requirements-dev.txt with ruff/pytest config.
- Update FASES_IMPLEMENTADAS.md with FASE 8 documentation.

Tests: 81 passing (61 console + 20 Facturapi).
This commit is contained in:
2026-06-15 04:58:42 +00:00
parent 6aff32f93b
commit d67887284d
15 changed files with 1559 additions and 481 deletions

View File

@@ -14,6 +14,7 @@ Usage:
import os
import sys
import psycopg2
MIGRATION_SQL = """
@@ -42,9 +43,7 @@ def get_tenant_db_names(master_dsn):
conn = psycopg2.connect(master_dsn)
try:
cur = conn.cursor()
cur.execute(
"SELECT id, db_name FROM tenants WHERE is_active = true ORDER BY id"
)
cur.execute("SELECT id, db_name FROM tenants WHERE is_active = true ORDER BY id")
rows = cur.fetchall()
cur.close()
return rows