using CashLineERP.Contracts.Tax;

namespace CashLineERP.Application.Tax;

public interface IEtaComplianceService
{
    EtaPayloadPreviewResponse? GetPayloadPreview(long accountsReceivableInvoiceId);

    EtaSubmissionValidationPackResponse? GetSubmissionValidationPack(long accountsReceivableInvoiceId);

    IReadOnlyCollection<EtaSubmissionLogResponse> GetSubmissionLogs(long accountsReceivableInvoiceId);

    IReadOnlyCollection<EtaDocumentEventResponse> GetDocumentEvents(long accountsReceivableInvoiceId);

    EtaSubmissionLogResponse SubmitInvoice(long accountsReceivableInvoiceId, SubmitInvoiceToEtaRequest request);

    EtaSubmissionLogResponse ResubmitRejectedInvoice(long accountsReceivableInvoiceId, long etaSubmissionLogId, ResubmitEtaInvoiceRequest request);

    EtaSubmissionLogResponse RecordInvoiceResponse(long accountsReceivableInvoiceId, long etaSubmissionLogId, RecordEtaInvoiceResponseRequest request);

    IReadOnlyCollection<EtaTransmissionAttemptResponse> GetTransmissions(long accountsReceivableInvoiceId);

    EtaTransmissionAttemptResponse? GetTransmission(long etaTransmissionAttemptId);

    IReadOnlyCollection<EtaTransmissionAttemptResponse> GetPendingAuthorityStatusPollBatch(int batchSize);

    EtaTransmissionAttemptResponse? FindPendingTransmissionByCorrelation(string correlationKey);

    EtaTransmissionAttemptResponse QueueTransmission(long accountsReceivableInvoiceId, long etaSubmissionLogId, long actorUserId);

    DispatchEtaTransmissionBatchResultResponse DispatchQueuedTransmissions(DispatchEtaTransmissionBatchRequest request);

    PollEtaTransmissionBatchResultResponse PollDispatchedTransmissions(PollEtaTransmissionBatchRequest request);

    EtaTransmissionAttemptResponse MarkTransmissionAccepted(long etaTransmissionAttemptId, long actorUserId, string processorCode, string etaUuid, string? responseText);

    EtaTransmissionAttemptResponse MarkTransmissionRejected(long etaTransmissionAttemptId, long actorUserId, string processorCode, string errorText, string? responseText, string? errorCode);

    EtaTransmissionAttemptResponse FailTransmission(long etaTransmissionAttemptId, long actorUserId, FailEtaTransmissionRequest request);

    EtaTransmissionAttemptResponse RetryTransmission(long etaTransmissionAttemptId, long actorUserId, RetryEtaTransmissionRequest request);
}
