Files
toiminnanohjaus-django/apps/jobs/application/queries.py
T
petriandClaude Opus 5.5 1ca03137fd Vaihe 1/4: asiakastyöt (numerointi, tagit, linkit, jäsenet, muutoshistoria)
- Uusi jobs-moduuli: asiakastyön kentät ilman rahakenttiä, juokseva
  vuosinumero VVVV-NNNN (laskuririvi lukitaan), tagit, linkit dialogissa,
  jäsenet ja muutoshistoria nimiarvoineen.
- Tilojen oikeudet: lasku luotu / laskutettu johto tai työn laskuttaja,
  arkistointi vain johto; alihankkija näkee vain jäsenyystyönsä eikä muokkaa.
- Lista ja haku (numero, nimi, asiakas), suodattimet, omat työt oletuksena,
  arkistoidut piilossa, myöhässä tekstinä ja kuvakkeena.
- Asiakasvalitsin hakuineen ja pikalisäyksineen (myös pikavastaanottoa varten).
- Asiakkaan sivulle asiakastyöt-osio; valikkoon Asiakastyöt.
- Lukurajapinnat muihin moduuleihin: UserQueries.choices,
  CustomerQueries.summaries, CatalogQueries.service_units; jobs.*-oikeudet.
- Import-linter-sopimukset, käännökset, testit (domain, application,
  integraatio, selain) sekä määrittelyn ja CLAUDE.md:n päivitys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-29 14:38:42 +02:00

43 lines
1.3 KiB
Python

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."""
...