package shop.alien.entity.store.dto;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * ant.merchant.expand.indirect.zft.simplecreate（直付通二级商户免证照进件）请求体。
 * <p>
 * 已含联系人、结算卡、开票、站点、行业资质等；公共参数中 {@link #appId}、{@code app_auth_token}、{@code api_version} 可显式传入。
 */
@Data
@ApiModel("直付通二级商户简化进件（zft.simplecreate）")
public class AlipayZftMerchantSimplecreateDto implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "门店ID", required = true)
    private Integer storeId;

    @ApiModelProperty("异步通知地址")
    private String notifyUrl;

    @ApiModelProperty("支付宝应用 app_id；不传则使用门店配置")
    @JsonProperty("app_id")
    @JsonAlias("appId")
    private String appId;

    @ApiModelProperty("应用授权令牌 app_auth_token（第三方代调用时选填）")
    @JsonProperty("app_auth_token")
    @JsonAlias("appAuthToken")
    private String appAuthToken;

    @ApiModelProperty("接口版本 api_version，一般无需传")
    @JsonProperty("api_version")
    @JsonAlias("apiVersion")
    private String apiVersion;

    @ApiModelProperty(value = "商户编号 external_id", required = true)
    @JsonProperty("external_id")
    @JsonAlias("externalId")
    private String externalId;

    @ApiModelProperty(value = "签约支付宝账户 binding_alipay_logon_id", required = true)
    @JsonProperty("binding_alipay_logon_id")
    @JsonAlias("bindingAlipayLogonId")
    private String bindingAlipayLogonId;

    @ApiModelProperty(value = "商户别名 alias_name", required = true)
    @JsonProperty("alias_name")
    @JsonAlias("aliasName")
    private String aliasName;

    @ApiModelProperty("商户客服电话 service_phone")
    @JsonProperty("service_phone")
    @JsonAlias("servicePhone")
    private String servicePhone;

    @ApiModelProperty(value = "二级商户名称 name", required = true)
    private String name;

    @ApiModelProperty(value = "商户类目 mcc", required = true)
    private String mcc;

    @ApiModelProperty(value = "开通服务列表 service", required = true)
    private List<String> service;

    @ApiModelProperty(value = "结算支付宝账号 alipay_logon_id（结算到支付宝时与 default_settle_rule 配合使用）")
    @JsonProperty("alipay_logon_id")
    @JsonAlias("alipayLogonId")
    private String alipayLogonId;

    @ApiModelProperty(value = "联系人 contact_infos（姓名、手机号在业务上必填）")
    @JsonProperty("contact_infos")
    @JsonAlias("contactInfos")
    private ContactPart contactInfos;

    @ApiModelProperty("默认结算规则 default_settle_rule")
    @JsonProperty("default_settle_rule")
    @JsonAlias("defaultSettleRule")
    private DefaultSettleRulePart defaultSettleRule;

    @ApiModelProperty("结算银行卡 biz_cards（结算到银行卡时填写，与支付宝结算二选一按文档）")
    @JsonProperty("biz_cards")
    @JsonAlias("bizCards")
    private SettleCardPart bizCards;

    @ApiModelProperty("经营地址 business_address（使用当面付等时按文档必填省市区与详细地址）")
    @JsonProperty("business_address")
    @JsonAlias("businessAddress")
    private AddressPart businessAddress;

    @ApiModelProperty("门头照，图片上传接口返回的 oss key")
    @JsonProperty("out_door_images")
    @JsonAlias("outDoorImages")
    private String outDoorImages;

    @ApiModelProperty("内景照，图片上传接口返回的 oss key")
    @JsonProperty("in_door_images")
    @JsonAlias("inDoorImages")
    private String inDoorImages;

    @ApiModelProperty("授权函/说明函图片，图片上传接口返回的 oss key")
    @JsonProperty("license_auth_letter_image")
    @JsonAlias("licenseAuthLetterImage")
    private String licenseAuthLetterImage;

    @Data
    @ApiModel("联系人")
    public static class ContactPart implements Serializable {
        private static final long serialVersionUID = 1L;
        @ApiModelProperty("姓名")
        private String name;
        @ApiModelProperty("手机号")
        private String mobile;
        @JsonProperty("id_card_no")
        @JsonAlias("idCardNo")
        @ApiModelProperty("身份证号")
        private String idCardNo;
        @ApiModelProperty("电话")
        private String phone;
        @ApiModelProperty("邮箱")
        private String email;
    }

    @Data
    @ApiModel("默认结算规则")
    public static class DefaultSettleRulePart implements Serializable {
        private static final long serialVersionUID = 1L;
        @JsonProperty("default_settle_type")
        @JsonAlias("defaultSettleType")
        @ApiModelProperty("alipayAccount / bankCard")
        private String defaultSettleType;
        @JsonProperty("default_settle_target")
        @JsonAlias("defaultSettleTarget")
        @ApiModelProperty("结算目标（支付宝登录号或银行卡号等）")
        private String defaultSettleTarget;
    }

    @Data
    @ApiModel("结算银行卡")
    public static class SettleCardPart implements Serializable {
        private static final long serialVersionUID = 1L;
        @JsonProperty("account_inst_name")
        @JsonAlias("accountInstName")
        private String accountInstName;
        @JsonProperty("bank_code")
        @JsonAlias("bankCode")
        private String bankCode;
        @JsonProperty("account_type")
        @JsonAlias("accountType")
        private String accountType;
        @JsonProperty("usage_type")
        @JsonAlias("usageType")
        private String usageType;
        @JsonProperty("account_holder_name")
        @JsonAlias("accountHolderName")
        private String accountHolderName;
        @JsonProperty("account_inst_city")
        @JsonAlias("accountInstCity")
        private String accountInstCity;
        @JsonProperty("account_inst_id")
        @JsonAlias("accountInstId")
        private String accountInstId;
        @JsonProperty("account_no")
        @JsonAlias("accountNo")
        private String accountNo;
        @JsonProperty("account_branch_name")
        @JsonAlias("accountBranchName")
        private String accountBranchName;
        @JsonProperty("account_inst_province")
        @JsonAlias("accountInstProvince")
        private String accountInstProvince;
    }

    @Data
    @ApiModel("地址")
    public static class AddressPart implements Serializable {
        private static final long serialVersionUID = 1L;
        private String address;
        @JsonProperty("district_code")
        @JsonAlias("districtCode")
        private String districtCode;
        private String latitude;
        @JsonProperty("city_code")
        @JsonAlias("cityCode")
        private String cityCode;
        private String poiid;
        @JsonProperty("province_code")
        @JsonAlias("provinceCode")
        private String provinceCode;
        private String longitude;
        @ApiModelProperty("如 BUSINESS_ADDRESS")
        private String type;
    }
}
