from msgbus import MBEasyContext

from abc import abstractmethod, ABCMeta

from services import OrderService


class FiscalProcessor(object):
    __metaclass__ = ABCMeta

    def __init__(
        self,           # type: FiscalProcessor
        mb_context,     # type: MBEasyContext
    ):
        # type: (...) -> None

        self.total_taxes = {}
        self.order_service = OrderService(mb_context=mb_context)

    @abstractmethod
    def terminate(self):
        pass

    @abstractmethod
    def request_fiscal(self, posid, order, tenders, paf=False, fiscal_id=None):
        pass

    @abstractmethod
    def do_validation(self, get_days_to_expiration=None):
        pass

    @abstractmethod
    def check_nf_situation(
        self,           # type: FiscalProcessor
        initial_date,   # type: str
        final_date,     # type: str
    ):
        # type: (...) -> (bool, str)

        raise NotImplementedError()
