package com.ai.da.service;


import com.ai.da.common.enums.CreditsEventsEnum;
import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.mapper.primary.entity.CreditsDetail;
import com.ai.da.model.dto.QueryIncomeOrExpenditureDTO;
import com.baomidou.mybatisplus.extension.service.IService;

public interface CreditsService extends IService<CreditsDetail> {

    void initCredits();

    Boolean buyCredits(Long accountId, Integer quantity);

    void creditsIncrease(Long accountId, String event);

    void creditsDecrease(Long accountId, String event);

    String getCredits(Long accountId);

    void creditsRefund(Long accountId, Integer quantity);

    void insertToCreditsDetail(Long accountId, String changeEvent, String credits, String changeType);

    PageBaseResponse<CreditsDetail> queryCreditsDetailsPage(QueryIncomeOrExpenditureDTO queryPageByTimeDTO);

    Boolean checkCredits(Long accountId, CreditsEventsEnum event, Integer num);

    Boolean creditsPreDeduction(CreditsEventsEnum event, Integer num);

    void taskCreditsDeduction(Long accountId, String taskId);
}
