from abc import (
    ABCMeta,
    abstractmethod
)
from datetime import datetime
from typing import (
    List,
    Optional,
    Tuple,
)


class OrderRepository(object):
    __metaclass__ = ABCMeta

    @abstractmethod
    def get_database_dir(self):
        # type: () -> str

        raise NotImplementedError()

    @abstractmethod
    def get_backup_database_dir(self):
        # type: () -> str

        raise NotImplementedError()

    @abstractmethod
    def get_orders(
        self,
        pos_id,         # type: int
        end_date,       # type: str,
        order_states,   # type: List[str]
    ):
        # type: (...) -> List[Tuple[int, str]]

        raise NotImplementedError()

    @abstractmethod
    def get_business_period_from_oldest_order(self):
        # type: (...) -> Optional[datetime]

        raise NotImplementedError()

    @abstractmethod
    def fill_order_backup_database(
        self,
        pos_id,         # type: int
        suffix_date,    # type: str
        orders          # type: List[int]
    ):
        # type: (...) -> None

        raise NotImplementedError()

    @abstractmethod
    def delete_orders(
        self,
        pos_id,     # type: int
        orders      # type: List[int]
    ):
        # type: (int, List[int]) -> None

        raise NotImplementedError()
