working on backend

This commit is contained in:
HotSwapp
2025-08-15 22:04:43 -05:00
parent abc7f289d1
commit 0347284556
16 changed files with 3929 additions and 33 deletions

View File

@@ -18,6 +18,32 @@ def ensure_schema_updates(engine: Engine) -> None:
"""Ensure missing columns are added for backward-compatible updates."""
# Map of table -> {column: SQL type}
updates: Dict[str, Dict[str, str]] = {
# Billing batch history (lightweight persistence)
"billing_batches": {
"id": "INTEGER",
"batch_id": "TEXT",
"status": "TEXT",
"total_files": "INTEGER",
"successful_files": "INTEGER",
"failed_files": "INTEGER",
"started_at": "DATETIME",
"updated_at": "DATETIME",
"completed_at": "DATETIME",
"processing_time_seconds": "FLOAT",
"success_rate": "FLOAT",
"error_message": "TEXT",
},
"billing_batch_files": {
"id": "INTEGER",
"batch_id": "TEXT",
"file_no": "TEXT",
"status": "TEXT",
"error_message": "TEXT",
"filename": "TEXT",
"size": "INTEGER",
"started_at": "DATETIME",
"completed_at": "DATETIME",
},
# Forms
"form_index": {
"keyword": "TEXT",