22 lines
725 B
Python
22 lines
725 B
Python
"""Abstract repository for ParentalLeaveFetch snapshots."""
|
|
|
|
from abc import abstractmethod
|
|
from uuid import UUID
|
|
|
|
from app.entities.parental_leave import ParentalLeaveFetch
|
|
from app.repositories.base import Repository
|
|
|
|
|
|
class ParentalLeaveRepository(Repository[ParentalLeaveFetch]):
|
|
@abstractmethod
|
|
async def get_latest_by_parent(
|
|
self, personal_data_uuid: UUID, child_id: UUID
|
|
) -> ParentalLeaveFetch | None:
|
|
"""Return the most recently fetched snapshot for a parent+child pair."""
|
|
|
|
@abstractmethod
|
|
async def list_history(
|
|
self, personal_data_uuid: UUID, child_id: UUID
|
|
) -> list[ParentalLeaveFetch]:
|
|
"""Return all snapshots for a parent+child pair, newest first."""
|