Fix dynamic tax year fallback in models and upload endpoints

This commit is contained in:
Atharv1705
2026-10-03 11:46:55 +05:30
parent 31fbc85565
commit 34a2cc0098
13 changed files with 139 additions and 14 deletions
+23
View File
@@ -0,0 +1,23 @@
import sys
import json
sys.path.append('.')
from app.db import SessionLocal
from app.models import RequiredDocumentTemplate, PersonalDocument, BusinessDocument
db = SessionLocal()
templates = db.query(RequiredDocumentTemplate).all()
pdocs = db.query(PersonalDocument).all()
bdocs = db.query(BusinessDocument).all()
print("--- TEMPLATES ---")
for t in templates:
print(f"[{t.category.upper()}] TY {t.tax_year} | {t.name}")
print("\n--- PERSONAL DOCS ---")
for d in pdocs:
print(f"ID {d.id} | User {d.user_id} | TY {d.tax_year} | {d.doc_type} | {d.review_status}")
print("\n--- BUSINESS DOCS ---")
for d in bdocs:
print(f"ID {d.id} | User {d.user_id} | TY {d.tax_year} | {d.business_type} | {d.review_status}")