package com.starry.admin.modules.withdraw.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
import com.starry.admin.modules.withdraw.entity.EarningsLineEntity;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

public interface IEarningsService extends IService<EarningsLineEntity> {
    void createFromOrder(PlayOrderInfoEntity orderInfo);

    BigDecimal getAvailableAmount(String clerkId, LocalDateTime now);

    BigDecimal getPendingAmount(String clerkId, LocalDateTime now);

    LocalDateTime getNextUnlockTime(String clerkId, LocalDateTime now);

    List<EarningsLineEntity> findWithdrawable(String clerkId, BigDecimal amount, LocalDateTime now);

    void createCounterLine(String orderId, String tenantId, String targetClerkId, BigDecimal amount, String operatorId);

    BigDecimal getRemainingEarningsForOrder(String orderId, String clerkId);
}
