| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- from datetime import datetime
- from sqlalchemy import DateTime, String, Text
- from sqlalchemy.orm import Mapped, mapped_column
- from app.common.enums import PermissionFilterStrategy
- from app.core.base_model import PaymentModelMixin, TenantMixin, EnterpriseMixin
- class ExpenseInstitutionModel(PaymentModelMixin, TenantMixin, EnterpriseMixin):
- """费控制度模型"""
- __tablename__ = "pay_expense_institution"
- __table_args__ = {"comment": "费控制度表"}
- __permission_strategy__ = PermissionFilterStrategy.ENTERPRISE_BASED
- institution_id: Mapped[str | None] = mapped_column(
- String(64), unique=True, index=True, comment="费控规则ID(创建后获取)"
- )
- institution_name: Mapped[str | None] = mapped_column(String(128), comment="制度名称")
- institution_desc: Mapped[str | None] = mapped_column(
- Text, comment="制度描述"
- )
-
- scene_type: Mapped[str | None] = mapped_column(
- String(32), default="GENERAL", comment="因公场景"
- )
- expense_type: Mapped[str] = mapped_column(
- String(32), default="GENERAL", comment="费用类型"
- )
- expense_sub_type: Mapped[str] = mapped_column(
- String(32), default="GENERAL", comment="费用类型子类"
- )
- status: Mapped[str] = mapped_column(
- String(32),
- default="INSTITUTION_CREATE",
- comment="状态: INSTITUTION_CREATE/INSTITUTION_EFFECTIVE/INSTITUTION_INVALID",
- )
- effective: Mapped[str | None] = mapped_column(
- String(32), default="1", comment="是否启用: 0(停用)/1(启用)"
- )
- effective_start_date: Mapped[datetime | None] = mapped_column(
- DateTime, comment="制度生效起始时间"
- )
- effective_end_date: Mapped[datetime | None] = mapped_column(
- DateTime, comment="制度生效结束时间"
- )
- consult_mode: Mapped[str | None] = mapped_column(
- String(32), default="0", comment="费控咨询模式: 0(支付宝内部计算)/1(咨询外部服务商)"
- )
- multi_employee_share_mode: Mapped[str | None] = mapped_column(
- String(32), default="0", comment="多员工分享模式: 0(不分享)/1(分享)"
- )
- currency: Mapped[str | None] = mapped_column(
- String(32), default="CNY", comment="货币类型"
- )
|