package com.ruoyi.frequency.wallerecord.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.controller.req.WalletPageReq;
import com.ruoyi.controller.resp.WalletPageResp;
import com.ruoyi.enums.WalletDetailEnums;
import com.ruoyi.frequency.wallerecord.entity.WalletRecord;
import com.ruoyi.frequency.wallerecord.model.param.EditUserBalanceParam;
import com.ruoyi.frequency.wallerecord.model.result.WalletRecordCount;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.BodyIdReq;
import com.ruoyi.vo.UserVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * 钱包记录Service接口
 *
 * @author liwenlong
 * @date 2023-07-20
 */
public interface WalletRecordService extends IService<WalletRecord>
{
    /**
     * 查询钱包记录
     *
     * @param id 钱包记录主键
     * @return 钱包记录
     */
    WalletRecord selectWalletRecordById(Long id);

    /**
     * 查询钱包记录列表
     *
     * @param walletRecord 钱包记录
     * @return 钱包记录集合
     */
    List<WalletRecord> selectWalletRecordList(WalletRecord walletRecord);

    /**
     * 新增钱包记录
     *
     * @param walletRecord 钱包记录
     * @return 结果
     */
    int insertWalletRecord(WalletRecord walletRecord);

    /**
     * 修改钱包记录
     *
     * @param walletRecord 钱包记录
     * @return 结果
     */
    int updateWalletRecord(WalletRecord walletRecord);

    /**
     * 批量删除钱包记录
     *
     * @param ids 需要删除的钱包记录主键集合
     * @return 结果
     */
    int deleteWalletRecordByIds(Long[] ids);

    /**
     * 删除钱包记录信息
     *
     * @param id 钱包记录主键
     * @return 结果
     */
    int deleteWalletRecordById(Long id);

    /**
     * 编辑用户余额
     *
     * @author liwenlong
     * @date 2023-04-27
     */
    ResponseData editUserBalance(EditUserBalanceParam param);


    /**
     * 修改余额
     * @param userVo 用户对象
     * @param walletDetailEnums 钱包类型枚举
     * @param objectId 来源id
     * @param updatePrice 修改金额 正加 负减
     * @param status 状态 1可提现 2不可提现 3到账取消
     */
    void updateBalance(UserVo userVo, WalletDetailEnums walletDetailEnums, Long objectId, BigDecimal updatePrice, Integer status);

    void updateBalance(UserVo userVo, WalletDetailEnums walletDetailEnums, String remark, Long objectId, BigDecimal updatePrice, Integer status);



    /**
     * app端用户钱包记录
     * @param req
     * @param userVo 用户对象
     * @return
     */
    ResponseData walletPage(WalletPageReq req, UserVo userVo);

    ResponseData expenditurePage(WalletPageReq req, UserVo userVo);

    ResponseData walletDetail(BodyIdReq req, UserVo userVo);

    WalletRecordCount statistics(WalletRecord walletRecord);
}
