from sqlalchemy import Column, Integer, String, DateTime from src.infrastructure.models.user_model import Base class LegalChargesModel(Base): """SQLAlchemy ORM model mapping to 'merchant_category_legal_charges' table. Each row defines one legal-charges rule for a merchant category. The rule has a condition (comparison direction), a loan-amount threshold, and the charge to apply when the condition is met. Note: this table has no deleted_at — soft-delete is not used here. """ __tablename__ = "merchant_category_legal_charges" id = Column(Integer, primary_key=True) category_id = Column(Integer, nullable=False) condition = Column(String(64), nullable=True) # 'loan_amount_less_than' | 'loan_amount_more_than' net_loan_amount = Column(Integer, nullable=True) # threshold (₹) legal_charges = Column(Integer, nullable=True) # charge amount (₹) created_by = Column(Integer, nullable=True) updated_by = Column(Integer, nullable=True) created_at = Column(DateTime, nullable=True) updated_at = Column(DateTime, nullable=True)