package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 微信支付服务商 - 特约商户进件申请单（本地落库主表）
 */
@Data
@ApiModel(value = "WechatPartnerApplyment对象", description = "微信支付服务商-特约商户进件申请单（本地落库）")
@TableName("wechat_partner_applyment")
public class WechatPartnerApplyment {

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("服务商商户号sp_mchid")
    @TableField("sp_mchid")
    private String spMchid;

    @ApiModelProperty("业务申请编号business_code")
    @TableField("business_code")
    private String businessCode;

    @ApiModelProperty("幂等键Idempotency-Key")
    @TableField("idempotency_key")
    private String idempotencyKey;

    /**
     * 关联本系统门店 {@link StoreInfo#getId()}，审核通过后用于回写 {@code store_info.wechat_sub_mchid}；
     * 提交进件时通过 query 参数 {@code storeId} 传入并落库（非微信请求字段）。
     */
    @ApiModelProperty("关联门店ID store_info.id")
    @TableField("store_id")
    private Integer storeId;

    @ApiModelProperty("微信支付申请单号applyment_id")
    @TableField("applyment_id")
    private Long applymentId;

    @ApiModelProperty("特约商户号sub_mchid")
    @TableField("sub_mchid")
    private String subMchid;

    @ApiModelProperty("超级管理员签约链接sign_url")
    @TableField("sign_url")
    private String signUrl;

    @ApiModelProperty("申请单状态applyment_state")
    @TableField("applyment_state")
    private String applymentState;

    @ApiModelProperty("申请状态描述applyment_state_msg")
    @TableField("applyment_state_msg")
    private String applymentStateMsg;

    @ApiModelProperty("是否通过：0未知/处理中 1通过 2驳回")
    @TableField("is_approved")
    private Integer isApproved;

    @ApiModelProperty("不通过理由（聚合audit_detail.reject_reason等）")
    @TableField("reject_reason")
    private String rejectReason;

    @ApiModelProperty("最后一次提交时间")
    @TableField("last_submit_time")
    private Date lastSubmitTime;

    @ApiModelProperty("最后一次查询时间")
    @TableField("last_query_time")
    private Date lastQueryTime;

    @ApiModelProperty("提交申请单请求体JSON（建议存最终提交给微信的那份）")
    @TableField("request_json")
    private String requestJson;

    @ApiModelProperty("最后一次提交微信响应原文JSON")
    @TableField("last_submit_resp_json")
    private String lastSubmitRespJson;

    @ApiModelProperty("最后一次查询微信响应原文JSON")
    @TableField("last_query_resp_json")
    private String lastQueryRespJson;

    @ApiModelProperty("创建时间")
    @TableField("created_at")
    private Date createdAt;

    @ApiModelProperty("更新时间")
    @TableField("updated_at")
    private Date updatedAt;
}

