maybe good

This commit is contained in:
HotSwapp
2025-08-08 15:55:15 -05:00
parent ab6f163c15
commit b257a06787
80 changed files with 19739 additions and 0 deletions

98
app/models/additional.py Normal file
View File

@@ -0,0 +1,98 @@
"""
Additional models for complete legacy system coverage
"""
from sqlalchemy import Column, Integer, String, Text, Date, Float, ForeignKey
from sqlalchemy.orm import relationship
from app.models.base import BaseModel
class Deposit(BaseModel):
"""
Daily bank deposit summaries
Corresponds to DEPOSITS table in legacy system
"""
__tablename__ = "deposits"
deposit_date = Column(Date, primary_key=True, index=True)
total = Column(Float, nullable=False, default=0.0)
notes = Column(Text)
# Relationships
payments = relationship("Payment", back_populates="deposit", cascade="all, delete-orphan")
def __repr__(self):
return f"<Deposit(date='{self.deposit_date}', total=${self.total})>"
class Payment(BaseModel):
"""
Individual payments within deposits
Corresponds to PAYMENTS table in legacy system
"""
__tablename__ = "payments"
id = Column(Integer, primary_key=True, autoincrement=True)
deposit_date = Column(Date, ForeignKey("deposits.deposit_date"), nullable=False)
file_no = Column(String(45), ForeignKey("files.file_no"), nullable=True)
client_id = Column(String(80), ForeignKey("rolodex.id"), nullable=True)
regarding = Column(Text)
amount = Column(Float, nullable=False, default=0.0)
note = Column(Text)
# Relationships
deposit = relationship("Deposit", back_populates="payments")
file = relationship("File", back_populates="payments")
client = relationship("Rolodex", back_populates="payments")
def __repr__(self):
return f"<Payment(id={self.id}, amount=${self.amount}, file='{self.file_no}')>"
class FileNote(BaseModel):
"""
Case file notes and memos
Corresponds to FILENOTS table in legacy system
"""
__tablename__ = "file_notes"
id = Column(Integer, primary_key=True, autoincrement=True)
file_no = Column(String(45), ForeignKey("files.file_no"), nullable=False, index=True)
memo_date = Column(Date, nullable=False, index=True)
memo_note = Column(Text, nullable=False)
# Relationships
file = relationship("File", back_populates="notes")
def __repr__(self):
return f"<FileNote(id={self.id}, file='{self.file_no}', date='{self.memo_date}')>"
class FormVariable(BaseModel):
"""
Document template variables for form generation
Corresponds to FVARLKUP table in legacy system
"""
__tablename__ = "form_variables"
identifier = Column(String(100), primary_key=True, index=True)
query = Column(String(500), nullable=False)
response = Column(Text)
active = Column(Integer, default=1) # Legacy system uses integer for boolean
def __repr__(self):
return f"<FormVariable(identifier='{self.identifier}')>"
class ReportVariable(BaseModel):
"""
Report template variables for report generation
Corresponds to RVARLKUP table in legacy system
"""
__tablename__ = "report_variables"
identifier = Column(String(100), primary_key=True, index=True)
query = Column(String(500), nullable=False)
active = Column(Integer, default=1) # Legacy system uses integer for boolean
def __repr__(self):
return f"<ReportVariable(identifier='{self.identifier}')>"