package com.sckw.redis.constant;

/**
 * @desc: redis常量
 * @author: yzc
 * @date: 2023-06-09 11:27
 */
public class RedisConstant {

    /**
     * 短信验证码值key
     */
    public static final String MESSAGE_SMS_VERIFY_CODE_VALUE_KEY = "message:sms:verifyCode:value:%s:%s";
    /**
     * 短信验证码请求key
     */
    public static final String MESSAGE_SMS_VERIFY_CODE_REQUEST_KEY = "message:sms:verifyCode:request:%s:%s";

    /**
     * 短信验证码请求时间
     */
    public static final Long SMS_VERIFY_CODE_REQUEST_TIME = 60L;
    /**
     * 短信验证码锁key
     */
    public static final String MESSAGE_SMS_VERIFY_CODE_LOCK_KEY = "message:sms:verifyCode:lock:%s:%s";
    /**
     * 短信验证码有效时间（秒）5分钟
     */
    public static final Long SMS_VERIFY_CODE_VALID_TIME = 300L;

    /**
     * message消费请求key
     */
    public static final String MESSAGE_CONSUMER_REQUEST_KEY = "message:msg:consumer:request:%s";

    /**
     * 商品更新库存锁key
     */
    public static final String GOODS_UPDATE_AMOUNT_KEY = "product:goods:update:amount:%s";
    /**
     * 更新贸易订单委托量、已履约量锁key
     */
    public static final String TORDER_UPDATE_AMOUNT_KEY = "order:trade:update:amount:%s";
    /**
     * 更新贸易订单地址下的委托量锁key
     */
    public static final String TORDER_ADDRESS_UPDATE_ENTRUST_AMOUNT = "order:trade:address:update:entrustAmount:%s";
    /**
     * 更新贸易订单地址下的实际交付量锁key
     */
    public static final String TORDER_ADDRESS_UPDATE_ACTUAL_AMOUNT = "order:trade:address:update:actualAmount:%s";
    /**
     * 合同签约完成更新贸易订单状态锁key
     */
    public static final String TORDER_CONTRACT_UPDATE_KEY = "order:trade:contract:update:%s";

    /**
     * 合同签约完成更新物流订单状态锁key
     */
    public static final String LOGISTICS_ORDER_CONTRACT_UPDATE_KEY = "order:trade:logistics:update:%s";
    /**
     * 生成贸易订单号锁key
     */
    public static final String TORDER_NO_GENERATE_KEY = "order:trade:no:generate:%s";

    /**
     * 生成物流订单号锁key
     */
    public static final String LOGISTICS_NO_GENERATE_KEY = "order:logistics:no:generate:%s";

    /**
     * 物流订单接单操作
     */
    public static final String LOGISTICS_ORDER_TAKING_KEY = "order:logistics:order:taking:%s";

    /**
     * 物流运单号生成key
     */
    public static final String WAYBILL_NO_GENERATE_KEY = "order:waybill:no:generate:%s";

    /**
     * 贸易订单生成物流托运锁key
     */
    public static final String TRADE_TO_LOGISTICS_NO_GENERATE_KEY = "order:trade:logistics:no:generate:%s";


    /**
     * 完结物流订单key
     */
    public static final String LOGISTICS_ORDER_FINISH_KEY = "order:logistics:no:finish:%s";

    /**
     * 取消物流订单key
     */
    public static final String LOGISTICS_ORDER_CANCEL_KEY = "order:logistics:no:cancel:%s";

    /**
     * 物流订单分包锁key
     */
    public static final String LOGISTICS_ORDER_SUBCONTRACT_KEY = "order:logistics:no:subcontract:%s";


    /**
     * 消费请求有效时间（秒）
     */
    public static final Long CONSUMER_REQUEST_VALID_TIME = 180L;
    /**
     * 结算单锁
     */
    public static final String SETTLEMENT_KEY = "sckw:kst:%s";
    /**
     * 企业关联钱包
     */
    public static final String WALLET_ENT = "wallet:ent";
    /**
     * 钱包关联企业
     */
    public static final String WALLET_UID = "wallet:uid";
    /**
     * 电子钱包时间记录
     * uid:filter:channel->time
     */
    public static final String WALLET_TIME = "%s:%s:%s";
    public static final String HOT_KEY = "hot:key";

    /**
     * 物流评分记录初始化锁,score:logistics:record:init:供应商企业id:物流企业id
     */
    public static final String LOGISTICS_SCORE_RECORD_INIT_KEY = "score:logistics:record:init:%s:%s";

    /**
     * 物流评分记录审批锁,score:logistics:record:approval:评分id
     */
    public static final String LOGISTICS_SCORE_RECORD_APPROVAL_KEY = "score:logistics:record:approval:%s";

    /**
     * 物流评分记录修改锁,score:logistics:record:update:评分id
     */
    public static final String LOGISTICS_SCORE_RECORD_UPDATE_KEY = "score:logistics:record:update:%s";

    /**
     * 物流评分记录重置锁,score:logistics:record:reset:评分id
     */
    public static final String LOGISTICS_SCORE_RECORD_RESET_KEY = "score:logistics:record:reset:%s";

    public static final String AUDIT_TRADE_CONTRACT = "audit:trade:contract:%s";
    public static final String AUDIT_TRADE_ORDER = "audit:trade:order:%s";
    public static final String AUDIT_LOGISTICS_TASK = "audit:logistics:task:%s";
    public static final String SIGN_TRADE_CONTRACT = "sign:trade:contract:%s";
    public static final String SIGN_LOGISTICS_CONTRACT = "sign:trade:contract:%s";

    public static final String CASH_LOCK = "sckw:cash:%s";


}
