package top.continew.admin.business.service;

import top.continew.admin.business.model.entity.PlantformBalanceDO;
import top.continew.admin.business.model.query.PlantformBalanceQuery;
import top.continew.admin.business.model.req.CheckPlantBalanceReq;
import top.continew.admin.business.model.req.PlantformBalanceAddReq;
import top.continew.admin.business.model.req.PlantformBalanceEditReq;
import top.continew.admin.business.model.resp.PlantformBalanceResp;
import top.continew.starter.data.mp.service.IService;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;
import top.continew.starter.web.model.R;

import java.util.List;

/**
 * 用户子账号余额表业务接口
 *
 * @author jiay
 * @since 2025/06/24 16:47
 */
public interface PlantformBalanceService extends IService<PlantformBalanceDO> {

    /**
     * 获取用户子账号余额列表
     *
     * @param query 用户子账号余额查询条件
     * @return 用户子账号余额列表
     */
    List<PlantformBalanceResp> getPlantformBalanceList(PlantformBalanceQuery query);

    /**
     * 添加用户子账号余额
     *
     * @param req 用户子账号余额
     * @return url
     */
    boolean addPlantformBalance(PlantformBalanceAddReq req);

    /**
     * 添加用户子账号余额
     *
     * @param req 用户子账号余额
     * @return 添加是否成功
     */
    boolean editPlantformBalance(PlantformBalanceEditReq req);

    /**
     * 添加用户子账号余额
     *
     * @param id 用户子账号余额id
     * @return 添加是否成功
     */
    boolean deletePlantformBalance(Long id);

    /**
     * 添加用户子账号余额
     *
     * @param id 用户子账号余额id
     * @return 用户子账号余额
     */
    PlantformBalanceResp getPlantformBalance(Long id);

    /**
     * 添加用户子账号余额
     *
     * @param query     用户子账号余额查询条件
     * @param pageQuery 分页参数
     * @return 用户子账号余额分页列表
     */
    PageResp<PlantformBalanceResp> getPlantformBalancePage(PlantformBalanceQuery query, PageQuery pageQuery);

    /**
     * 根据用户ID获取用户所有子账户余额
     *
     * @param userId 用户ID
     * @return 用户子账号余额列表
     */
    List<PlantformBalanceResp> getUserBalancesByUserId(Long userId);

    /**
     * 判断余额是否充足
     *
     * @param req 用子账号余额查询条件
     * @return 子账号余额是否充足
     */
    R checkPlantBalance(CheckPlantBalanceReq req);
}