maybe good
This commit is contained in:
66
app/models/qdro.py
Normal file
66
app/models/qdro.py
Normal file
@@ -0,0 +1,66 @@
|
||||
"""
|
||||
QDRO models based on legacy QDRO.SC analysis
|
||||
"""
|
||||
from sqlalchemy import Column, Integer, String, Date, Text, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
from app.models.base import BaseModel
|
||||
|
||||
|
||||
class QDRO(BaseModel):
|
||||
"""
|
||||
Legal documents (QDROs - Qualified Domestic Relations Orders)
|
||||
Corresponds to QDROS table in legacy system
|
||||
"""
|
||||
__tablename__ = "qdros"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
file_no = Column(String(45), ForeignKey("files.file_no"), nullable=False)
|
||||
version = Column(String(10), default="01") # Version of QDRO
|
||||
plan_id = Column(String(45)) # Plan identifier
|
||||
|
||||
# CSV fields from legacy system
|
||||
field1 = Column(String(100)) # ^1 field
|
||||
field2 = Column(String(100)) # ^2 field
|
||||
part = Column(String(100)) # ^Part field
|
||||
altp = Column(String(100)) # ^AltP field
|
||||
pet = Column(String(100)) # ^Pet field (Petitioner)
|
||||
res = Column(String(100)) # ^Res field (Respondent)
|
||||
|
||||
# Case information
|
||||
case_type = Column(String(45)) # Case type
|
||||
case_code = Column(String(45)) # Case code
|
||||
section = Column(String(45)) # Court section
|
||||
case_number = Column(String(100)) # Case number
|
||||
|
||||
# Dates
|
||||
judgment_date = Column(Date) # Judgment date
|
||||
valuation_date = Column(Date) # Valuation date
|
||||
married_on = Column(Date) # Marriage date
|
||||
|
||||
# Award information
|
||||
percent_awarded = Column(String(100)) # Percent awarded (can be formula)
|
||||
|
||||
# Venue information
|
||||
ven_city = Column(String(50)) # Venue city
|
||||
ven_cnty = Column(String(50)) # Venue county
|
||||
ven_st = Column(String(2)) # Venue state
|
||||
|
||||
# Document status dates
|
||||
draft_out = Column(Date) # Draft sent out date
|
||||
draft_apr = Column(Date) # Draft approved date
|
||||
final_out = Column(Date) # Final sent out date
|
||||
|
||||
# Court information
|
||||
judge = Column(String(100)) # Judge name
|
||||
form_name = Column(String(200)) # Form/template name
|
||||
|
||||
# Additional fields
|
||||
status = Column(String(45), default="DRAFT") # DRAFT, APPROVED, FILED, etc.
|
||||
content = Column(Text) # Document content/template
|
||||
notes = Column(Text) # Additional notes
|
||||
|
||||
# Relationships
|
||||
file = relationship("File", back_populates="qdros")
|
||||
|
||||
def __repr__(self):
|
||||
return f"<QDRO(file_no='{self.file_no}', version='{self.version}', case_number='{self.case_number}')>"
|
||||
Reference in New Issue
Block a user