from abc import ABCMeta, abstractmethod
from typing import (
    Optional,
    List,
)
from xml.etree import cElementTree as eTree

from posot import OrderTaker

from interactor.route.payment.insert.dto import OrderInsertPaymentRequest
from interactor.route.electronic_payment.send_responses.dto import SendResponsesRequest


class FiscalServiceModel(object):
    __metaclass__ = ABCMeta

    @abstractmethod
    def process_order_fiscal(
        self,
        model,              # type: eTree
        pos_ot,             # type: OrderTaker
        print_coupon=True,  # type: bool
    ):
        # type: (...) -> Optional[str]

        raise NotImplementedError

    @abstractmethod
    def process_payment(self, model, request):
        # type: (eTree, OrderInsertPaymentRequest) -> None

        raise NotImplementedError

    def cancel_electronic_payment(
        self,
        model,      # type: eTree
        request,    # type: OrderInsertPaymentRequest
    ):
        # type: (...) -> None

        raise NotImplementedError

    @abstractmethod
    def send_electronic_payment_message_response(self, model, request):
        # type: (eTree, SendResponsesRequest) -> None

        raise NotImplementedError

    def get_customer_receipts(
        self,
        model,      # type: eTree
    ):
        # type: (...) -> List[str]

        raise NotImplementedError

