<?php

namespace Fifa\ConnectId\Sdk\Tms;

use Fifa\ConnectId\Sdk\Exception\TmsOperationException;
use Fifa\ConnectId\Sdk\Model\DataStandard\PersonLocal;
use Fifa\ConnectId\Sdk\Model\Transfer\DomesticTransferDeclaration;
use Fifa\ConnectId\Sdk\Model\Transfer\FirstProRegistration;
use Fifa\ConnectId\Sdk\Model\Transfer\ProofOfPayment;
use InvalidArgumentException;

interface TmsFacadeInterface
{
    /**
     * Adds player in TMS system via Service Bus
     *
     * @param PersonLocal $personLocal - Person details using FIFA Data Standard
     * @return string - Correlation Id of the request
     *
     * @throws TmsOperationException
     */
    public function addPlayer(PersonLocal $personLocal): string;

    /**
     * Updates existing player in TMS system via Service Bus
     *
     * @param PersonLocal $personLocal - Person details using FIFA Data Standard
     * @return string - Correlation Id of the request
     *
     * @throws TmsOperationException
     */
    public function updatePlayer(PersonLocal $personLocal): string;

    /**
     * Sends DTS declaration to TMS system via Service Bus
     *
     * @param DomesticTransferDeclaration $declaration - Transfer details using FIFA Data Standard
     * @param int $timeoutSeconds - Time to wait for response to arrive
     * @return int - TMS Transfer Id
     *
     * @throws TmsOperationException
     * @throws ResponseNotReceivedException
     * @throws DeclarationRejectedException
     * @throws InvalidArgumentException
     */
    public function declareDomesticTransferAndWaitForTransferId(DomesticTransferDeclaration $declaration, int $timeoutSeconds): int;

    /**
     * Sends Proof Of Payment to TMS system via Service Bus
     *
     * @param ProofOfPayment $proofOfPayment - Payment details using FIFA Data Standard
     * @param int $timeoutSeconds - Time to wait for response to arrive
     * @return int - TMS Payment Id
     *
     * @throws TmsOperationException
     * @throws DeclarationRejectedException
     * @throws ResponseNotReceivedException
     */
    public function provePaymentAndWaitForPaymentId(ProofOfPayment $proofOfPayment, int $timeoutSeconds): int;

    /**
     * Sends FirstProRegistration to TMS system via Service Bus
     *
     * @param FirstProRegistration $firstProRegistration
     * @param int $timeoutSeconds - Time to wait for response to arrive
     * @return int - TMS First Registration Id
     *
     * @throws TmsOperationException
     * @throws ResponseNotReceivedException
     * @throws DeclarationRejectedException
     * @throws InvalidArgumentException
     */
    public function declareFirstProRegistrationAndWaitForRegistrationId(FirstProRegistration $firstProRegistration, int $timeoutSeconds): int;
}
