package com.ruoyi.system.service;

import com.ruoyi.system.domain.PosOrderLinePayment;

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

public interface IPosOrderLinePaymentService {
    PosOrderLinePayment createRequesting(String ddId, String lineOrderId, Long credentialId,
                                         Long storeId, Integer amount, String currency,
                                         Date reconcileDeadline);
    PosOrderLinePayment createRequesting(String ddId, String lineOrderId, Long credentialId,
                                         Long storeId, Integer amount, String currency,
                                         String paymentMode, Date reconcileDeadline);
    PosOrderLinePayment getActiveByDdId(String ddId);
    PosOrderLinePayment getByLineOrderId(String lineOrderId);
    PosOrderLinePayment getByTransactionId(String transactionId);
    PosOrderLinePayment getById(Long id);
    List<PosOrderLinePayment> getByDdId(String ddId);
    List<PosOrderLinePayment> getCancelledPaidWithoutRefund(int batchSize);
    int markTerminal(Long id, Long version, String expectedStatus, String targetStatus);
    int markRequestSucceeded(Long id, Long version, String transactionId,
                             String paymentUrlWeb, String paymentUrlApp,
                             Date nextReconcileAt, Date reconcileDeadline);
    int markRequestUnknown(Long id, Long version, Date nextReconcileAt, Date reconcileDeadline);
    int markOfflineWaitingAuth(Long id, Long version, String transactionId,
                               Date nextReconcileAt, Date reconcileDeadline);
    int markOfflineEvidence(Long id, Long version, String expectedStatus, String targetStatus,
                            String transactionId, String paymentProvider, Integer capturedAmount,
                            Date payTime);
    int rescheduleOffline(Long id, Long version, String expectedStatus,
                          Date nextReconcileAt, Date reconcileDeadline);
    int claimConfirm(Long id, Long version, String expectedStatus, String leaseOwner, Date leaseUntil);
    int markAuthDoneOrderCancelled(Long id, Long version, String expectedStatus,
                                   Date nextReconcileAt, Date reconcileDeadline);
    int markConfirmUnknown(Long id, Long version, Date nextReconcileAt, Date reconcileDeadline);
    int markPaid(Long id, Long version, String expectedStatus,
                 String transactionId, String paymentProvider, Date payTime);
    int markManualReview(Long id, Long version, String expectedStatus);
    List<PosOrderLinePayment> scanDue(Date now, int batchSize);
    int claimReconcileLease(Long id, Long version, String leaseOwner, Date leaseUntil, Date now);
    void applyActiveKeyInvariant(PosOrderLinePayment payment);
}
