package com.ruoyi.xq.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.xq.domain.ConsumeLog;
import com.ruoyi.xq.domain.User;
import com.ruoyi.xq.domain.UserExtend;
import com.ruoyi.xq.dto.admin.user.UserExtendAdminVo;
import com.ruoyi.xq.dto.admin.user.req.UpdateIncomeCoinReq;
import com.ruoyi.xq.dto.admin.user.req.UpdateWxTransNumReq;
import com.ruoyi.xq.enums.account.WxTransLogCateEnum;
import com.ruoyi.xq.enums.user.AccountChangeCodeEnum;

import java.math.BigDecimal;

/**
 * 用户邀请Service接口
 *
 * @author 77
 * @date 2024-03-04
 */
public interface UserExtendService extends IService<UserExtend> {

    boolean withdraw(Long userId, BigDecimal withdrawPrice,String traceId);
    void resetWithdraw(Long userId, BigDecimal withdrawMoney, String traceId);

    boolean incsWithdrawTotal(Long userId, BigDecimal withdrawMonty);
    boolean incsConsumeTotal(Long userId, BigDecimal consumeMonty);

    Page<UserExtendAdminVo> pageAdmin(PageQuery pageQuery, UserExtendAdminVo bo);

    void updateIncomeCoin(UpdateIncomeCoinReq bo);

    boolean distribution(ConsumeLog consumer, Long userId, BigDecimal amount, AccountChangeCodeEnum changeCodeEnum);

    void updateWxTransNum(UpdateWxTransNumReq bo);

    boolean consumeWxTrans(Long sponsorUserId, User receiveUser, String traceId);

    boolean incsWxTrans(Long userId,Integer wxTransNum, WxTransLogCateEnum cateEnum, String traceId, String remark);

    UserExtend getByUserId(Long id);


    UserExtend getByUserCode(String usercode);
}
