diff --git a/backend/sync_invoice_types.py b/backend/sync_invoice_types.py deleted file mode 100644 index cdcf23b5..00000000 --- a/backend/sync_invoice_types.py +++ /dev/null @@ -1,35 +0,0 @@ -from core.database import CoreSessionLocal -from api.v1.modules.public.reference_data.invoice_types.models import InvoiceType -from api.v1.modules.public.reference_data.invoice_types.seed import seed - -def sync_invoice_types(): - db = CoreSessionLocal() - try: - for s in seed: - key, description, note, type_, operation = s - obj = db.query(InvoiceType).filter(InvoiceType.key == key).first() - if obj: - print(f"Updating {key}...") - obj.description = description - obj.note = note - obj.type = type_ - obj.operation = operation - else: - print(f"Creating {key}...") - obj = InvoiceType( - key=key, - description=description, - note=note, - type=type_, - operation=operation - ) - db.add(obj) - db.commit() - except Exception as e: - print(f"Error: {e}") - db.rollback() - finally: - db.close() - -if __name__ == "__main__": - sync_invoice_types()