| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- from datetime import datetime
- from sqlalchemy import Boolean, DateTime, Integer, String, Text
- from sqlalchemy.orm import Mapped, mapped_column
- from app.core.base_model import PaymentModelMixin, TenantMixin
- from .enums import FacetofaceOrderStatus
- class FacetofaceOrderModel(PaymentModelMixin, TenantMixin):
- """当面付开通申请单"""
- __tablename__ = "pay_facetoface_order"
- __table_args__ = {"comment": "当面付开通申请单"}
- enterprise_id: Mapped[str | None] = mapped_column(
- String(64), unique=True, index=True, comment="关联企业ID"
- )
- batch_no: Mapped[str | None] = mapped_column(
- String(64), unique=True, index=True, comment="支付宝事务编号"
- )
- order_no: Mapped[str | None] = mapped_column(
- String(64), index=True, comment="支付宝申请单号"
- )
- order_status: Mapped[str] = mapped_column(
- String(32),
- default=FacetofaceOrderStatus.INIT.value,
- index=True,
- comment="申请单状态",
- )
- merchant_name: Mapped[str | None] = mapped_column(
- String(128), comment="商户名称"
- )
- shop_name: Mapped[str | None] = mapped_column(
- String(128), comment="店铺名称"
- )
- shop_address: Mapped[str | None] = mapped_column(
- String(256), comment="店铺地址"
- )
- mcc_code: Mapped[str | None] = mapped_column(
- String(32), comment="商户类别码"
- )
- rate: Mapped[str | None] = mapped_column(
- String(16), comment="费率"
- )
- business_license_no: Mapped[str | None] = mapped_column(
- String(64), comment="营业执照号"
- )
- business_license_mobile: Mapped[str | None] = mapped_column(
- String(32), comment="联系手机号"
- )
- sign_and_auth: Mapped[bool] = mapped_column(
- Boolean, default=False, comment="是否同时获取授权"
- )
- confirm_url: Mapped[str | None] = mapped_column(
- Text, comment="商家确认链接"
- )
- app_auth_token: Mapped[str | None] = mapped_column(
- String(128), comment="商家授权token"
- )
- reject_reason: Mapped[str | None] = mapped_column(
- Text, comment="驳回原因"
- )
- remark: Mapped[str | None] = mapped_column(
- Text, comment="备注"
- )
- last_query_time: Mapped[datetime | None] = mapped_column(
- DateTime, comment="最后查询时间"
- )
- next_query_time: Mapped[datetime | None] = mapped_column(
- DateTime, index=True, comment="下次查询时间"
- )
- query_count: Mapped[int] = mapped_column(
- Integer, default=0, comment="已查询次数"
- )
|