package hr.com.port.ips.eracun.provider;

import hr.com.port.ips.eracun.provider.model.Ack;
import hr.com.port.ips.eracun.provider.model.Ping;
import hr.com.port.ips.eracun.provider.model.doc.DocumentBinary;
import hr.com.port.ips.eracun.provider.model.doc.DocumentHeader;
import hr.com.port.ips.eracun.provider.model.doc.DocumentRef;
import hr.com.port.ips.eracun.provider.model.doc.DocumentSnapshot;
import hr.com.port.ips.eracun.provider.model.ereporting.EReportingDoc;
import hr.com.port.ips.eracun.provider.model.ereporting.EReportingRequests;
import hr.com.port.ips.eracun.provider.model.ereporting.PaymentReport;
import hr.com.port.ips.eracun.provider.model.ereporting.RejectionReport;
import hr.com.port.ips.eracun.provider.model.ids.DocumentKey;
import hr.com.port.ips.eracun.provider.model.ids.RemoteId;
import hr.com.port.ips.eracun.provider.model.paging.ListFilter;
import hr.com.port.ips.eracun.provider.model.paging.Page;
import hr.com.port.ips.eracun.provider.model.status.ProcessStatusChange;
import hr.com.port.ips.eracun.provider.model.validate.ValidationResult;

public interface EracunProvider {

    // Documents
    DocumentRef send(String ublXml, String softwareId) throws ProviderException;

    DocumentBinary getXml(RemoteId id) throws ProviderException;
    DocumentBinary getPdf(RemoteId id) throws ProviderException;

    DocumentSnapshot get(RemoteId id) throws ProviderException;

    Ack changeProcessStatus(RemoteId id, ProcessStatusChange change) throws ProviderException;

    ValidationResult validate(String ublXml) throws ProviderException;

    // Listing
    Page<DocumentHeader> listIncoming(ListFilter f) throws ProviderException;
    Page<DocumentHeader> listOutgoing(ListFilter f) throws ProviderException;

    // eReporting
    Ack reportDocument(EReportingDoc req) throws ProviderException;
    Ack reportPayment(PaymentReport pr) throws ProviderException;
    Ack reportRejection(RejectionReport rr) throws ProviderException;
    EReportingRequests listEReportingRequests(DocumentKey key) throws ProviderException;

    // Other
    Ping ping() throws ProviderException;

    ProviderCapabilities capabilities();
}
