package com.ruoyi.ss.recordBalance.service;

import java.math.BigDecimal;
import java.util.List;
import com.ruoyi.ss.recordBalance.domain.RecordBalance;
import com.ruoyi.ss.recordBalance.domain.RecordBalanceVO;
import com.ruoyi.ss.recordBalance.domain.RecordBalanceQuery;
import com.ruoyi.ss.recordBalance.domain.enums.RecordBalanceBstType;

/**
 * 余额变动记录Service接口
 *
 * @author ruoyi
 * @date 2024-07-22
 */
public interface RecordBalanceService
{
    /**
     * 查询余额变动记录
     *
     * @param id 余额变动记录主键
     * @return 余额变动记录
     */
    public RecordBalanceVO selectRecordBalanceById(Long id);

    /**
     * 查询余额变动记录列表
     *
     * @param recordBalance 余额变动记录
     * @return 余额变动记录集合
     */
    public List<RecordBalanceVO> selectRecordBalanceList(RecordBalanceQuery recordBalance);

    /**
     * 新增余额变动记录
     *
     * @param recordBalance 余额变动记录
     * @return 结果
     */
    public int insertRecordBalance(RecordBalance recordBalance);

    /**
     * 修改余额变动记录
     *
     * @param recordBalance 余额变动记录
     * @return 结果
     */
    public int updateRecordBalance(RecordBalance recordBalance);

    /**
     * 批量删除余额变动记录
     *
     * @param ids 需要删除的余额变动记录主键集合
     * @return 结果
     */
    public int deleteRecordBalanceByIds(Long[] ids);

    /**
     * 删除余额变动记录信息
     *
     * @param id 余额变动记录主键
     * @return 结果
     */
    public int deleteRecordBalanceById(Long id);

    /**
     * 添加余额变动记录
     *
     * @param userId        用户ID
     * @param beforeBalance 变动前余额
     * @param amount        变动的金额
     * @param reason        变动原因
     * @param bstType
     * @param bstId
     */
    int record(Long userId, BigDecimal beforeBalance, BigDecimal amount, String reason, RecordBalanceBstType bstType, Long bstId);

    /**
     * 查询用户余额变动记录
     */
    RecordBalanceVO selectRecordBalanceById(Long id, Long userId);

    /**
     * 查询一个
     */
    RecordBalanceVO selectOne(RecordBalanceQuery query);
}
