using CashLineERP.Contracts.External;
using CashLineERP.Contracts.IslamicFinance;
using CashLineERP.Contracts.Parties;
using CashLineERP.Contracts.Procurement;
using CashLineERP.Contracts.Customers;
using CashLineERP.Contracts.Sales;
using CashLineERP.Contracts.Suppliers;
using CashLineERP.Application.External.Views;

namespace CashLineERP.Application.External;

public interface IExternalPortalService
{
    IReadOnlyCollection<ExternalRfqInvitationResponse> GetRfqInvitations(long partyId);

    ExternalRfqInvitationDetailResponse? GetRfqInvitation(long partyId, long rfqId);

    ExternalRfqInvitationDetailResponse RespondToRfqInvitation(long partyId, long actorUserId, long rfqId, RespondExternalRfqInvitationRequest request);

    IReadOnlyCollection<ExternalQuotationResponse> GetQuotations(long partyId);

    SupplierQuotationResponse? GetQuotation(long partyId, long quotationId);

    SupplierQuotationResponse CreateQuotation(long partyId, long actorUserId, CreateExternalSupplierQuotationRequest request);

    SupplierQuotationResponse SubmitQuotation(long partyId, long quotationId, long actorUserId);

    SupplierProfileResponse? GetSupplierProfile(long partyId);

    SupplierProfileResponse CreateSupplierProfile(long partyId, CreateSupplierProfileRequest request);

    SupplierProfileResponse SubmitSupplierProfile(long partyId, long actorUserId);

    CustomerProfileResponse? GetCustomerProfile(long partyId);

    CustomerProfileResponse CreateCustomerProfile(long partyId, CreateCustomerProfileRequest request);

    CustomerProfileResponse SubmitCustomerProfile(long partyId, long actorUserId);

    IReadOnlyCollection<ExternalOrderResponse> GetOrders(long partyId);

    IReadOnlyCollection<ExternalDocumentWorkflowResponse> GetDocumentWorkflows(long partyId);

    ExternalDocumentWorkflowResponse? GetDocumentWorkflow(long partyId, long workflowId);

    ExternalDocumentWorkflowResponse CreateDocumentWorkflow(long partyId, long actorUserId, CreateExternalDocumentWorkflowRequest request);

    ExternalDocumentWorkflowResponse SubmitDocumentWorkflow(long partyId, long workflowId, long actorUserId);

    ExternalDocumentWorkflowResponse ReplaceDocumentWorkflow(long partyId, long workflowId, long actorUserId, ReplaceExternalDocumentWorkflowRequest request);

    ExternalDocumentWorkflowResponse ApproveDocumentWorkflow(long workflowId, long actorUserId, ReviewExternalDocumentWorkflowRequest request);

    ExternalDocumentWorkflowResponse ReturnDocumentWorkflow(long workflowId, long actorUserId, ReviewExternalDocumentWorkflowRequest request);

    ExternalDocumentWorkflowResponse RejectDocumentWorkflow(long workflowId, long actorUserId, ReviewExternalDocumentWorkflowRequest request);

    SalesOrderResponse CreateCustomerOrder(long partyId, CreateExternalCustomerOrderRequest request);

    SalesOrderResponse SubmitCustomerOrder(long partyId, long orderId, long actorUserId);

    IReadOnlyCollection<ExternalPurchaseOrderResponse> GetPurchaseOrders(long partyId);

    ExternalPurchaseOrderResponse AcknowledgePurchaseOrder(long partyId, long purchaseOrderId, long actorUserId, AcknowledgeExternalPurchaseOrderRequest request);

    ExternalPurchaseOrderResponse RaisePurchaseOrderIssue(long partyId, long purchaseOrderId, long actorUserId, RaiseExternalPurchaseOrderIssueRequest request);

    IReadOnlyCollection<ExternalInvoiceResponse> GetInvoices(long partyId);

    ExternalPaymentResponse CreateCustomerPayment(long partyId, long actorUserId, CreateExternalCustomerPaymentRequest request);

    IReadOnlyCollection<ExternalPaymentResponse> GetPayments(long partyId);

    ExternalCustomerPaymentStatusResponse GetCustomerPaymentStatus(long partyId, long paymentId);

    IReadOnlyCollection<ExternalCustomerDeliveryResponse> GetCustomerDeliveries(long partyId);

    IReadOnlyCollection<ExternalCustomerServiceRequestResponse> GetCustomerServiceRequests(long partyId);

    ExternalCustomerServiceRequestResponse CreateCustomerServiceRequest(long partyId, long actorUserId, CreateExternalCustomerServiceRequestRequest request);

    ExternalCustomerServiceRequestResponse SubmitCustomerServiceRequest(long partyId, long serviceRequestId, long actorUserId);

    ExternalCustomerServiceRequestResponse EscalateCustomerServiceRequest(long partyId, long serviceRequestId, long actorUserId, EscalateExternalCustomerServiceRequestRequest request);

    ExternalCustomerServiceRequestResponse RouteCustomerServiceRequest(long serviceRequestId, long actorUserId, RouteExternalCustomerServiceRequestRequest request);

    ExternalCustomerServiceRequestResponse StartCustomerServiceRequestReview(long serviceRequestId, long actorUserId);

    ExternalCustomerServiceRequestResponse RespondToCustomerServiceRequest(long serviceRequestId, long actorUserId, ReviewExternalCustomerServiceRequest request);

    ExternalCustomerServiceRequestResponse RejectCustomerServiceRequest(long serviceRequestId, long actorUserId, ReviewExternalCustomerServiceRequest request);

    ExternalCustomerServiceRequestResponse CloseCustomerServiceRequest(long serviceRequestId, long actorUserId, CloseExternalCustomerServiceRequest request);

    ExternalCustomerStatusTrackingResponse GetCustomerStatusTracking(long partyId);

    IReadOnlyCollection<ExternalCustomerDocumentResponse> GetCustomerDocuments(long partyId);

    BusinessPartyComplianceDocumentResponse RecordCustomerDocument(long partyId, long actorUserId, RecordBusinessPartyComplianceDocumentRequest request);

    ExternalStatementSummaryResponse GetStatementSummary(long partyId, DateOnly? dateFrom = null, DateOnly? dateTo = null, string? currencyCode = null);

    IReadOnlyCollection<ExternalStatementLineResponse> GetStatementLines(long partyId, DateOnly? dateFrom = null, DateOnly? dateTo = null, string? currencyCode = null);

    IReadOnlyCollection<ExternalStatementDocumentResponse> GetStatementDocuments(long partyId);

    ExternalStatementDetailResponse? GetStatementDetail(long partyId, long statementId);

    IReadOnlyCollection<ExternalStatementDeliveryLogResponse> GetStatementDeliveryLogs(long partyId, long statementId);

    IReadOnlyCollection<IslamicFinanceProductProfileResponse> GetFinancingProducts(long partyId);

    IReadOnlyCollection<IslamicFinanceFinancingRequestResponse> GetFinancingRequests(long partyId);

    IslamicFinanceFinancingRequestResponse? GetFinancingRequest(long partyId, long financingRequestId);

    IslamicFinanceFinancingRequestResponse CreateFinancingRequest(long partyId, CreateExternalFinancingApplicationRequest request);

    IslamicFinanceFinancingRequestResponse SubmitFinancingRequest(long partyId, long financingRequestId, long actorUserId);

    IslamicFinanceFinancingRequestResponse AcceptFinancingOffer(long partyId, long financingRequestId, long actorUserId, AcceptExternalFinancingOfferRequest request);

    IReadOnlyCollection<ExternalFinancingOfferResponse> GetFinancingOffers(long partyId);

    IReadOnlyCollection<ExternalFinancingOfferResponse> GetFinancingOffersForRequest(long partyId, long financingRequestId);

    IReadOnlyCollection<ExternalFinancingNotificationResponse> GetFinancingNotifications(long partyId, long financingRequestId);

    IReadOnlyCollection<ExternalFinancingTaskResponse> GetFinancingTasks(long partyId);

    ExternalFinancingJourneySummaryResponse? GetFinancingJourneySummary(long partyId, long financingRequestId);

    IReadOnlyCollection<ExternalFinancingProductFamilyView> GetFinancingProductFamilies(long partyId);

    IReadOnlyCollection<IslamicFinanceReceivablesCaseResponse> GetReceivablesCases(long partyId);

    IslamicFinanceReceivablesCaseResponse? GetReceivablesCase(long partyId, long receivablesCaseId);

    IReadOnlyCollection<IslamicFinanceMurabahaCaseResponse> GetMurabahaCases(long partyId);

    IslamicFinanceMurabahaCaseResponse? GetMurabahaCase(long partyId, long murabahaCaseId);

    IReadOnlyCollection<IslamicFinanceMurabahaDisbursementResponse> GetMurabahaDisbursements(long partyId);

    IslamicFinanceMurabahaDisbursementResponse? GetMurabahaDisbursement(long partyId, long disbursementId);

    IReadOnlyCollection<IslamicFinanceSettlementResponse> GetSettlements(long partyId);

    IslamicFinanceSettlementResponse? GetSettlement(long partyId, long settlementId);
}
