package cn.pluss.platform.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @author Djh
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
public class MerchantImage {

    public static class ImageType {

        /**
         * 商户负责人与收银台合照
         */
        public static final String CASH_DESK_WITH_PERSON = "999";

        /**
         * 身份证正面
         */
        public static final String IDCARD_FRONT = "01";
        /**
         * 身份证反面
         */
        public static final String IDCARD_BACK = "02";
        /**
         * 营业执照
         */
        public static final String BUSINESS_LICENSE = "03";
        /**
         * 组织机构代码证
         */
        public static final String ORGANIZATION_CARD = "04";
        /**
         * 开户许可证
         */
        public static final String ACCOUNT_PERMITS = "05";
        /**
         * 门头照
         */
        public static final String SHOP_FRONT_DOOR = "06";
        /**
         * 非法人结算授权书
         */
        public static final String NON_LEG_SETTLE_AUTH = "07";
        /**
         * 法人/非法人手持结算授权书
         */
        public static final String HAND_NON_LEG_SETTLE_AUTH = "B004";
        /**
         * 其他
         */
        public static final String OTHER = "08";
        /**
         * 收银台照片
         */
        public static final String CASH_DESK_PHOTO = "08";
        /**
         * 门店内景照片
         */
        public static final String STORE_INTERIOR_PHOTO = "09";
        /**
         * 各大餐饮平台入驻
         */
        public static final String MERCHANT_PLATFORM = "10";
        /**
         * 手持身份证
         */
        public static final String HAND_IDCARD_PHOTO = "11";
        /**
         * 租赁合同
         */
        public static final String TENANCY_AGREEMENTS = "12";
        /**
         * 结算人身份证正面
         */
        public static final String SETTLE_IDCARD_FRONT = "96";
        /**
         * 结算人身份证反面
         */
        public static final String SETTLE_IDCARD_BACK = "97";
        /**
         * 银行卡正面
         */
        public static final String BANK_CARD_FRONT = "98";
        /**
         * 银行卡反面
         */
        public static final String BANK_CARD_BACK = "99";

        /**
         * 商户协议
         */
        public static final String MERCHANT_PROTOCOL = "101";
        /**
         * 商户附属协议
         */
        public static final String MERCHANT_SUB_PROTOCOL = "102";

        private ImageType() {
        }
    }

    public MerchantImage(String merchantCode, String photoType) {
        this.merchantCode = merchantCode;
        this.photoType = photoType;
    }

    public static MerchantImage from(String picUrl, String photoType) {
        MerchantImage mi = new MerchantImage();
        mi.setPhotoType(photoType).setPicUrl(picUrl);

        return mi;
    }

    @TableId
    private Integer id;

    @TableField
    private String merchantCode;

    /**
     * 01 身份证正面
     * ,02 身份证反面
     * ,03 营业执照
     * ,04 组织机构代码证
     * ,05 开户许可证
     * ,06 门头照
     * ,07 非法人结算授权书
     * ,08 其他
     * ,08 收银台照片
     * ,09 门店内景照片
     * ,10 各大餐饮平台入驻
     * ,11 手持身份证合照
     * ,12 租赁合同
     * ,98  银行卡正面
     * ,99，银行卡反面
     */
    @TableField
    private String photoType;
    private String photoUrl;
    private String picUrl;
    @TableField(exist = false)
    private String picUrl1;
    @TableField(exist = false)
    private String picUrl2;
    @TableField(exist = false)
    private String picUrl3;
    @TableField(exist = false)
    private String picUrl6;
    @TableField(exist = false)
    private String picUrl7;
    @TableField(exist = false)
    private String picUrl8;
    @TableField(exist = false)
    private String picUrl9;
    @TableField(exist = false)
    private String picUrl999;
    @TableField(exist = false)
    private String picUrl101;
    @TableField(exist = false)
    private String picUrl102;
    @TableField(exist = false)
    private String picUrl11;

    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createDt;
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateDt;
    private String aisleSwitch;
}

