| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- 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="申请单状态",
- )
- account: Mapped[str | None] = mapped_column(
- String(128), comment="商户支付宝账号/pid"
- )
- contact_name: Mapped[str | None] = mapped_column(
- String(32), comment="联系人名称"
- )
- contact_mobile: Mapped[str | None] = mapped_column(
- String(16), comment="联系人手机号"
- )
- contact_email: Mapped[str | None] = mapped_column(
- String(64), comment="联系人邮箱"
- )
- order_ticket: Mapped[str | None] = mapped_column(
- String(40), comment="订单授权凭证(预授权模式)"
- )
- rate: Mapped[str | None] = mapped_column(
- String(8), comment="费率(sign_and_auth=true时必填)"
- )
- sign_and_auth: Mapped[bool] = mapped_column(
- Boolean, default=False, comment="是否签约且授权"
- )
- merchant_pid: Mapped[str | None] = mapped_column(
- String(32), comment="商户pid(query返回)"
- )
- confirm_url: Mapped[str | None] = mapped_column(
- Text, comment="商家确认链接"
- )
- app_auth_token: Mapped[str | None] = mapped_column(
- String(128), comment="应用授权令牌"
- )
- app_refresh_token: Mapped[str | None] = mapped_column(
- String(128), comment="刷新令牌"
- )
- auth_app_id: Mapped[str | None] = mapped_column(
- String(32), comment="授权商户的appId"
- )
- user_id: Mapped[str | None] = mapped_column(
- String(32), comment="授权商户的userId"
- )
- open_id: Mapped[str | None] = mapped_column(
- String(128), comment="授权商户的openId"
- )
- expires_in: Mapped[str | None] = mapped_column(
- String(16), comment="授权令牌过期秒数"
- )
- re_expires_in: Mapped[str | None] = mapped_column(
- String(16), comment="刷新令牌过期秒数"
- )
- 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="已查询次数"
- )
|