package com.ruoyi.bst.creditUser.service;

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

import com.ruoyi.bst.creditUser.domain.CreditUser;
import com.ruoyi.bst.creditUser.domain.CreditUserQuery;
import com.ruoyi.bst.creditUser.domain.CreditUserVO;

/**
 * 挂账用户Service接口
 *
 * @author ruoyi
 * @date 2025-05-28
 */
public interface CreditUserService
{
    /**
     * 查询挂账用户
     *
     * @param id 挂账用户主键
     * @return 挂账用户
     */
    public CreditUserVO selectCreditUserById(Long id, boolean scope);

    default CreditUserVO selectCreditUserById(Long id) {
        return selectCreditUserById(id, false);
    }

    /**
     * 查询挂账用户列表
     *
     * @param creditUser 挂账用户
     * @return 挂账用户集合
     */
    public List<CreditUserVO> selectCreditUserList(CreditUserQuery creditUser);

    /**
     * 新增挂账用户
     *
     * @param creditUser 挂账用户
     * @return 结果
     */
    public int insertCreditUser(CreditUser creditUser);

    /**
     * 修改挂账用户
     *
     * @param creditUser 挂账用户
     * @return 结果
     */
    public int updateCreditUser(CreditUser creditUser);

    /**
     * 批量删除挂账用户
     *
     * @param ids 需要删除的挂账用户主键集合
     * @return 结果
     */
    public int deleteCreditUserByIds(List<Long> ids);

    /**
     * 增加使用金额
     * @param id id 
     * @param amount 金额
     * @return
     */
    public int addUsedAmount(Long id, BigDecimal amount);


}
