package com.ruoyi.system.service;

import com.ruoyi.system.domain.PosOrderLinePayment;
import com.ruoyi.system.domain.PosOrderLineRefund;

import java.util.Date;
import java.util.List;

public interface IPosOrderLineRefundService {
    PosOrderLineRefund getByPaymentId(Long paymentId);
    PosOrderLineRefund createIfAbsent(PosOrderLinePayment payment, String source);
    int claimProcessing(Long id, Long version, String expectedStatus,
                        String leaseOwner, Date leaseUntil);
    int markUnknown(Long id, Long version, Date nextReconcileAt, Date reconcileDeadline);
    int markRetryWait(Long id, Long version, Date nextReconcileAt);
    int markFailed(Long id, Long version);
    int recoverExpiredProcessing(Long id, Long version, Date nextReconcileAt,
                                 Date reconcileDeadline);
    int rescheduleUnknown(Long id, Long version, Date nextReconcileAt,
                          Date reconcileDeadline);
    int markRefunded(Long id, Long version, String refundTransactionId, Date refundTime);
    int markRefundedFromEvidence(Long id, Long version, String expectedStatus,
                                 String refundTransactionId, Date refundTime);
    int markManualReview(Long id, Long version, String expectedStatus);
    int markManualReviewFromEvidence(Long id, Long version, String expectedStatus);
    List<PosOrderLineRefund> scanDue(Date now, int batchSize);
}
