from collections.abc import Sequence from typing import Protocol from apps.jobs.domain.entities import ChangeRecord, CustomerJob, JobLink from apps.jobs.domain.value_objects import JobNumber class CustomerJobRepository(Protocol): def get(self, job_id: int) -> CustomerJob | None: ... def save(self, job: CustomerJob) -> CustomerJob: """Insert or update, service units, members and tags included. New tag names are added to the shared tag list.""" ... def next_number(self, year: int) -> JobNumber: """Reserve the next number of the year. Locks the year's counter, so call it inside the use case's transaction; concurrent saves never share a number.""" ... def record_changes( self, job_id: int, user_id: int, changes: Sequence[ChangeRecord] ) -> None: ... class JobLinkRepository(Protocol): def get(self, link_id: int) -> JobLink | None: ... def save(self, link: JobLink) -> JobLink: ... def delete(self, link_id: int) -> None: ...