- 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]>
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
from collections.abc import Iterable, Sequence
|
|
from typing import Protocol
|
|
|
|
from apps.catalog.application.dto import ServiceUnitNode, ServiceUnitSummary, WorkTypeOption
|
|
|
|
|
|
class CatalogQueries(Protocol):
|
|
"""Public read interface of the catalog module.
|
|
|
|
A row is selectable when it and every parent above it are active.
|
|
"""
|
|
|
|
def tree(self) -> Sequence[ServiceUnitNode]:
|
|
"""The whole hierarchy in order, inactive rows included (base data page)."""
|
|
...
|
|
|
|
def active_service_units(self) -> Sequence[ServiceUnitSummary]:
|
|
"""Active service units in order, the shared unit included (``is_shared``)."""
|
|
...
|
|
|
|
def service_units(self, ids: Iterable[int]) -> Sequence[ServiceUnitSummary]:
|
|
"""The given service units in order, also inactive ones (for showing stored rows)."""
|
|
...
|
|
|
|
def work_type_options(self, service_unit_ids: Iterable[int]) -> Sequence[WorkTypeOption]:
|
|
"""Selectable work types of the given units plus those of the shared unit."""
|
|
...
|
|
|
|
def get_work_type(self, work_type_id: int) -> WorkTypeOption | None:
|
|
"""Any work type, also one no longer selectable (for showing stored rows)."""
|
|
...
|