package com.sonic.lion.service;

import com.sonic.lion.domain.entity.AccountBuffAwaiting;
import org.springframework.lang.NonNull;

import java.util.List;

/**
 * @author: code
 * @date: 2025/07/17
 * @Description:
 * @version: 1.0.0
 */
public interface AccountBuffAwaitingService {

    /**
     * 保存数据
     *
     * @param accountBuffAwaiting
     */
    void save(@NonNull AccountBuffAwaiting accountBuffAwaiting);

    /**
     * 查询将要入账的记录
     *
     * @param num
     * @return
     */
    List<AccountBuffAwaiting> listWillToIncome(Integer num);

    /**
     * 根据tradeNo查询
     *
     * @param tradeNo
     * @return
     */
    AccountBuffAwaiting getByTradeNo(String tradeNo);

    List<AccountBuffAwaiting> getListByTradeNo(String tradeNo);

    /**
     * 更新带入账记录状态
     *
     * @param id
     * @param status
     */
    void updateStatus(@NonNull Long id, @NonNull AccountBuffAwaiting.Status status, AccountBuffAwaiting.Status expectStatus);

    /**
     * 更新待入账数据的buff数
     *
     * @param id
     * @param awaitingBuff
     * @param expectStatus
     */
    void updateAwaitingBuff(@NonNull Long id, @NonNull Long awaitingBuff, AccountBuffAwaiting.Status expectStatus);

    void fronzenBuffAwaiting(List<String> tradeNoList);

    void unFronzenBuffAwaiting(List<String> tradeNoList);

    boolean deleteById(Long id);

    int updateOldData();

    /**
     * 获取商家订阅待入账的数目
     *
     * @param tradeNo
     * @return
     */
    int countMerchantSubscribeAwaitingIncome(String tradeNo,Long accountId);
}
