Add cash payment compliance and accounting tools
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import date, datetime
|
||||
|
||||
from sqlalchemy import Date, DateTime, Float, ForeignKey, Integer, UniqueConstraint
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.core.db.common import CommonBase
|
||||
|
||||
|
||||
class CashPaymentRuleSetting(CommonBase):
|
||||
__tablename__ = "accounting_cash_payment_rule_settings"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("tenant_id", name="uq_cash_payment_rule_settings_tenant"),
|
||||
)
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
tenant_id: Mapped[int] = mapped_column(ForeignKey("tenants.id", ondelete="CASCADE"), index=True)
|
||||
cash_limit: Mapped[float] = mapped_column(Float, default=10000.0)
|
||||
effective_from: Mapped[date] = mapped_column(Date, default=date(2017, 4, 1))
|
||||
split_window_days: Mapped[int] = mapped_column(Integer, default=3)
|
||||
near_limit_percent: Mapped[float] = mapped_column(Float, default=80.0)
|
||||
max_allocation_days: Mapped[int] = mapped_column(Integer, default=5)
|
||||
updated_by_user_id: Mapped[int | None] = mapped_column(ForeignKey("users.id", ondelete="SET NULL"), nullable=True)
|
||||
created_at_utc: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
|
||||
updated_at_utc: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|
||||
Reference in New Issue
Block a user