package com.kxs.store.biz.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kxs.store.api.model.KxsWarehouseLimit;
import com.kxs.store.api.vo.kxsapp.storeAdvance.AdvanceUserDetailVO;
import com.kxs.store.api.vo.kxsapp.storeLimit.WarehouseAmountVO;
import com.kxs.store.api.vo.kxsapp.userAdvance.AdvanceAmountVO;

/**
 * 客小爽仓库额度表(KxsWarehouseLimit)表服务接口
 *
 * @author 系统
 * @since 2024-01-08 09:46:02
 */
public interface KxsWarehouseLimitService extends IService<KxsWarehouseLimit> {

    /**
     * 预发货小分仓 获取用户详细信息
     *
     * @param userCode 用户代码
     * @return {@link AdvanceUserDetailVO}
     */
    AdvanceUserDetailVO getUserDetail(String userCode);

    /**
     * 用户预发机额度详情
     *
     * @return {@link AdvanceAmountVO}
     */
    AdvanceAmountVO advanceAmount();

    /**
     * 仓库额度详情
     *
     * @return {@link WarehouseAmountVO}
     */
    WarehouseAmountVO warehouseAmount();

    /**
     * 用户预发额度更新
     *
     * @param toUserId 到用户 ID
     * @param amount   类型
     * @param kind     add sub
     */
    void refreshUserAmount(Integer toUserId, Integer amount, String kind);

    /**
     * 刷新仓库金额
     *
     * @param userId      用户 ID
     * @param amount      量
     * @param kind        add sub
     */
    void refreshWarehouseAmount(Integer userId, int amount, String kind);

    /**
     * 用户预发机额度初始化
     *
     * @param kxsWarehouseLimit KXS仓库限制
     * @return {@link Boolean}
     */
    Boolean addUserAdvanceLimit(KxsWarehouseLimit kxsWarehouseLimit);

    /**
     * 添加临时额度
     *
     * @param param 参数
     * @return {@link Boolean}
     */
    Boolean addForAmount(KxsWarehouseLimit param);
}

