package com.yonge.cooleshow.biz.dal.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yonge.cooleshow.biz.dal.enums.AccountBizTypeEnum;
import com.yonge.cooleshow.biz.dal.enums.GoodTypeEnum;
import com.yonge.cooleshow.biz.dal.vo.UserAccountRecordVo;
import com.yonge.cooleshow.biz.dal.dto.search.UserAccountRecordSearch;
import com.yonge.cooleshow.biz.dal.entity.UserAccountRecord;
import com.yonge.cooleshow.biz.dal.vo.UserAccountVo;
import com.yonge.cooleshow.biz.dal.vo.UserOrderDetailVo;
import com.yonge.cooleshow.biz.dal.vo.res.AccountTotal;
import com.yonge.cooleshow.common.entity.HttpResponseResult;

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

/**
 * 用户账户流水表 服务类
 *
 * @author liweifan
 * @date 2022-03-30
 */
public interface UserAccountRecordService extends IService<UserAccountRecord> {

    /**
     * 查询详情
     *
     * @author liweifan
     * @date 2022-03-30
     */
    UserAccountRecordVo detail(Long id);

    UserAccountRecordVo detail(String orderNo, AccountBizTypeEnum bizType, Long bizId);
    /**
     * 分页查询
     *
     * @author liweifan
     * @date 2022-03-30
     */
    IPage<UserAccountRecordVo> selectPage(IPage<UserAccountRecordVo> page, UserAccountRecordSearch query);

    List<UserAccountRecordVo> selectAll(UserAccountRecordSearch query);


    /**
     * 分页查询
     *
     * @author liweifan
     * @date 2022-03-30
     */
    IPage<UserAccountRecordVo> sharePage(IPage<UserAccountRecordVo> page, UserAccountRecordSearch query);
    /**
     * app查询详情
     *
     * @author liweifan
     * @date 2022-03-30 13:53:51
     * @return: com.yonge.cooleshow.biz.dal.vo.UserAccountRecordVo
     */
    UserAccountRecordVo appDetail(Long id);
    /**
     * app分页查询
     *
     * @author liweifan
     * @date 2022-03-30 13:53:51
     * @return: com.yonge.cooleshow.biz.dal.vo.UserAccountRecordVo
     */
    IPage<UserAccountRecordVo> appSelectPage(IPage<UserAccountRecordVo> page, UserAccountRecordSearch query);

    /**
     * 老师本月收入
     *
     * @param userId 老师id
     * @return 老师本月收入
     */
    BigDecimal getMonthDecimal(Long userId);

    /**
     * 老师课酬收入通知
     */
    void sendTeacherEarning();

    /**
     * 通过订单详情查询该详情对应的所有账户记录
     */
    List<UserAccountRecord> selectRecordByOrderDetail(UserOrderDetailVo userOrderDetailVo);


    HttpResponseResult<UserAccountVo> accountTotal(UserAccountRecordSearch query);

    /**
     * 修改老师账户入账状态
     */
    void updateWaitRecord();
}