package com.jeesharp.business.modules.pay.paysubmerchantapplyment.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.jeesharp.framework.mybatis.core.dataobject.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 微信支付特约商户进件申请单实体，映射表 {@code biz_pay_sub_merchant_applyment}。
 *
 * @author jeesharp
 * @since 2026-05-26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("biz_pay_sub_merchant_applyment")
@Schema(description = "特约商户进件申请单")
public class PaySubMerchantApplyment extends BaseEntity<PaySubMerchantApplyment> {

    @Schema(description = "进件所属租户ID（企业租户表主键，业务字段；与数据隔离 tenant_id 分离）")
    private String applymentTenantId;

    @Schema(description = "进件所属租户编号（企业租户表 code，业务字段）")
    private String applymentTenantCode;

    @Schema(description = "业务申请编号")
    private String businessCode;

    @Schema(description = "微信支付申请单号")
    private Long applymentId;

    @Schema(description = "特约商户号")
    private String subMchId;

    @Schema(description = "商户简称")
    private String merchantShortname;

    @Schema(description = "主体类型")
    private String subjectType;

    @Schema(description = "申请状态（本地或微信 applyment_state）")
    private String applyStatus;

    @Schema(description = "状态说明")
    private String applyStatusDesc;

    @Schema(description = "签约链接")
    private String signUrl;

    @Schema(description = "提交时使用的微信配置ID")
    private String wechatConfigId;

    /**
     * 进件 API 类型：APPLYMENT4SUB / ECOMMERCE；存量 NULL 视为 APPLYMENT4SUB。
     *
     * @see com.jeesharp.business.modules.pay.paysubmerchantapplyment.enums.PaySubMerchantApplymentApiTypeEnum
     */
    @Schema(description = "进件API类型：APPLYMENT4SUB-特约进件；ECOMMERCE-电商进件")
    private String applymentApiType;

    @Schema(description = "进件草稿 JSON")
    private String draftJson;

    @Schema(description = "最近提交请求 JSON")
    private String lastSubmitJson;

    @Schema(description = "最近查询响应 JSON")
    private String lastQueryJson;

    @Schema(description = "提交时间")
    private LocalDateTime submitDate;

    @Schema(description = "最近同步时间")
    private LocalDateTime lastSyncDate;
}
