package com.jeesharp.business.modules.pay.paywechatconfig.dto;

import com.jeesharp.framework.pojo.dto.BaseSaveDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 微信支付 V3 配置保存请求 DTO。
 *
 * @author jeesharp
 * @since 2026-05-25
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "微信支付配置保存请求")
public class PayWechatConfigSaveDTO extends BaseSaveDTO {

    @Schema(description = "关联 pay_channel_config.id（从渠道配置列表进入时携带，用于子表按主表 upsert）")
    private String channelConfigId;

    @NotBlank(message = "配置编码不能为空")
    @Schema(description = "配置编码", requiredMode = Schema.RequiredMode.REQUIRED)
    private String configCode;

    @Schema(description = "配置名称")
    private String configName;

    @Schema(description = "记录状态：0-禁用 1-启用")
    private Integer status;
    @Schema(description = "是否调用真实微信 V3：0-否 1-是")
    private Integer wxEnabled;

    @Schema(description = "AppId")
    private String appId;
    @Schema(description = "商户号")
    private String mchId;

    @Schema(description = "微信支付模式：DIRECT-境内直连 PARTNER-收付通合作伙伴")
    private String wechatPayMode;

    @Schema(description = "商户 API 证书序列号")
    private String merchantSerialNo;
    @Schema(description = "商户 API 私钥 PEM")
    private String merchantPrivateKeyPem;
    @Schema(description = "微信支付公钥 ID")
    private String publicKeyId;
    @Schema(description = "微信支付公钥 PEM")
    private String publicKeyPem;
    @Schema(description = "微信支付公钥路径")
    private String publicKeyPath;
    @Schema(description = "p12 证书路径")
    private String certPath;
    @Schema(description = "商户私钥 PEM 路径")
    private String certPrivateKeyPath;
    @Schema(description = "商户证书 PEM 路径")
    private String certPrivateCertPath;
    @Schema(description = "APIv2 密钥")
    private String mchKey;

    @Schema(description = "回调基地址")
    private String notifyBaseUrl;
    @Schema(description = "支付中心回调相对路径")
    private String payCenterNotifyPath;

    @Schema(description = "APIv3 密钥")
    private String apiV3Key;
    @Schema(description = "是否跳过回调验签：0-否 1-是")
    private Integer skipSignatureVerify;
    @Schema(description = "平台证书序列号")
    private String platformSerialNo;

    @Schema(description = "备注")
    private String remarks;

    @Schema(description = "租户 ID，留空表示平台默认")
    private String tenantId;
}
