|
@@ -0,0 +1,39 @@
|
|
|
|
|
+from sqlalchemy import String, Text
|
|
|
|
|
+from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
|
+
|
|
|
|
|
+from app.common.enums import PermissionFilterStrategy
|
|
|
|
|
+from app.core.base_model import PaymentModelMixin, TenantMixin, EnterpriseMixin
|
|
|
|
|
+
|
|
|
|
|
+from .enums import RuleStatusEnum
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+class ExpenseRuleModel(PaymentModelMixin, TenantMixin, EnterpriseMixin):
|
|
|
|
|
+ """使用规则模型"""
|
|
|
|
|
+
|
|
|
|
|
+ __tablename__ = "pay_expense_rule"
|
|
|
|
|
+ __table_args__ = {"comment": "使用规则表"}
|
|
|
|
|
+ __permission_strategy__ = PermissionFilterStrategy.ENTERPRISE_BASED
|
|
|
|
|
+
|
|
|
|
|
+ out_biz_no: Mapped[str] = mapped_column(
|
|
|
|
|
+ String(64), unique=True, index=True, comment="外部业务编号"
|
|
|
|
|
+ )
|
|
|
|
|
+ institution_id: Mapped[str] = mapped_column(
|
|
|
|
|
+ String(64), index=True, comment="制度ID"
|
|
|
|
|
+ )
|
|
|
|
|
+ rule_id: Mapped[str | None] = mapped_column(
|
|
|
|
|
+ String(64), comment="规则ID(支付宝返回)"
|
|
|
|
|
+ )
|
|
|
|
|
+ standard_name: Mapped[str | None] = mapped_column(
|
|
|
|
|
+ String(128), comment="规则名称"
|
|
|
|
|
+ )
|
|
|
|
|
+ standard_desc: Mapped[str | None] = mapped_column(
|
|
|
|
|
+ Text, comment="规则描述"
|
|
|
|
|
+ )
|
|
|
|
|
+ expense_type_sub_category: Mapped[str | None] = mapped_column(
|
|
|
|
|
+ String(32), comment="费用类型子类"
|
|
|
|
|
+ )
|
|
|
|
|
+ status: Mapped[str] = mapped_column(
|
|
|
|
|
+ String(32),
|
|
|
|
|
+ default=RuleStatusEnum.RULE_ACTIVE.value,
|
|
|
|
|
+ comment="状态: RULE_ACTIVE/RULE_INACTIVE"
|
|
|
|
|
+ )
|