Files
GTI_GERENCIADOR_FISCAL/central/scripts/import_legacy_ncm.py
T

26 lines
766 B
Python

"""Seed reviewed official legacy NCM evidence; it never selects a successor."""
from central.app.db import SessionLocal
from central.app.models import LegacyNcmEntry
LEGACY_NCM = {
"code": "02071400",
"source": "Siscomex NCM official nomenclature download",
"source_date": "2026-09-17",
"reason": "NCM not present in current official nomenclature; no official successor.",
}
def main():
with SessionLocal() as session:
entry = session.get(LegacyNcmEntry, LEGACY_NCM["code"])
if entry is None:
session.add(LegacyNcmEntry(**LEGACY_NCM, successor_code=None))
session.commit()
print({"code": LEGACY_NCM["code"], "status": "LEGACY_NCM", "successor_code": None})
if __name__ == "__main__":
main()