from abc import (
    ABC,
    abstractmethod,
)
from datetime import datetime
from typing import List
from uuid import UUID

from .._EventPublishDetail import EventPublishDetail


class EventRepository(ABC):
    @abstractmethod
    def save_event(self, event: EventPublishDetail):
        raise NotImplementedError()

    @abstractmethod
    def get_pending(self) -> List[EventPublishDetail]:
        raise NotImplementedError()

    @abstractmethod
    def get_abandoned(self) -> List[EventPublishDetail]:
        raise NotImplementedError()

    @abstractmethod
    def save(self, event_definition: EventPublishDetail) -> None:
        raise NotImplementedError()

    @abstractmethod
    def get_by_id(self, id: UUID) -> EventPublishDetail:
        raise NotImplementedError()

    @abstractmethod
    def get_by_external_code(self, external_code: str):
        raise NotImplementedError()

    def cleanup_abandoned_events(self, min_abandoned_date: datetime):
        raise NotImplementedError()

    def cleanup_acked_events(self, min_acked_date: datetime):
        raise NotImplementedError()
