package com.jeequan.jeepay.db.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jeequan.jeepay.core.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>
 * 商户配置表
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2023-03-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_agent_config")
public class AgentConfig extends BaseModel {

    private static final long serialVersionUID=1L;

    /** 当前服务商进件配置管理方式：    configVal:   DEF-平台全局默认配置 ,  CUSTOM-自定义   **/
    public static final String KEY_APPLYMENT_AUDIT_MODE = "applymentAuditMode";
    public static final String KEY_APPLYMENT_AUDIT_MODE_DEF = "DEF";
    public static final String KEY_APPLYMENT_AUDIT_MODE_CUSTOM = "CUSTOM";

    /** 当前服务商进件是否需要运营平台预审核 **/
    public static final String KEY_AGENT_APPLYMENT_PRE_AUDIT_CONFIG = "agentApplymentPreAuditConfig";

    /** 服务商发起进件时间限制：    configVal:
     *  [开始时间, 结束时间], // 若为空表示不限制。
     *  **/
    public static final String KEY_AGENT_APPLY_TIME_LIMIT_CONFIG = "agentApplyTimeLimitConfig";

    /** 同步对象的类型 allCurrentAndSubAgent-当前及所有下级**/
    public static final String IF_ALL_CURRENT_AND_SUB_AGENT = "allCurrentAndSubAgent";

    /** 服务商进件配置group_key **/
    public static final String GROUP_KEY_APPLYMENT_CONFIG = "applymentConfig";

    /**
     * 服务商子商户配置微信参数权限
     **/
    public static final String CONFIG_KEY_WX_CONFIG_IS_USABLE_CONFIG = "subMchWxConfigIsUsable";
    /**
     * 服务商子商户配置支付接口权限
     **/
    public static final String CONFIG_KEY_MCH_PAY_INTERFACE_IS_USABLE_CONFIG = "subMchPayInterfaceConfigIsUsable";

    public static final LambdaQueryWrapper<AgentConfig> gw(){
        return new LambdaQueryWrapper<>();
    }

    public AgentConfig(){}

    public AgentConfig(String agentNo, String configKey, String configVal, String groupKey){
        this.agentNo = agentNo;
        this.configKey = configKey;
        this.configVal = configVal;
        this.groupKey = groupKey;
    }

    /**
     * 服务商号
     */
    private String agentNo;

    /**
     * 配置KEY
     */
    private String configKey;

    /**
     * 配置内容项
     */
    private String configVal;

    /**
     * 配置分组
     */
    private String groupKey;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 更新时间
     */
    private Date updatedAt;


}
