from collections.abc import Sequence from typing import Protocol from apps.jobs.application.dto import ( Actor, JobChangeView, JobDetails, JobFilters, JobLinkView, JobListItem, ) class CustomerJobQueries(Protocol): """Public read interface of the jobs module. A subcontractor sees only the jobs he or she is a member of (specification 16.4). """ def list_jobs(self, filters: JobFilters, viewer: Actor) -> Sequence[JobListItem]: """Newest first. Search matches the number, the name and the customer's name. "Mine" = responsible, contact person, biller or member. Archived jobs only when asked for (``include_archived`` or the archived status filter).""" ... def jobs_for_customer(self, customer_id: int, viewer: Actor) -> Sequence[JobListItem]: """All jobs of a customer, archived included, newest first.""" ... def is_visible_to(self, job_id: int, viewer: Actor) -> bool: ... def get_details(self, job_id: int) -> JobDetails | None: ... def changes(self, job_id: int) -> Sequence[JobChangeView]: """Change history, newest first.""" ... def links(self, job_id: int) -> Sequence[JobLinkView]: ... def tag_names(self) -> Sequence[str]: """Every tag in the shared list, alphabetically.""" ...