- Uusi catalog-moduuli: palveluyksikkö → (palvelu) → työtehtävä ilman hintoja. - Pohjatiedot-sivu /catalog/ pääkäyttäjälle ja johdolle (oikeus catalog.manage): lisäys ja muokkaus dialogissa, Siirrä ylös / Siirrä alas, käytöstä poisto ja käyttöön otto. Fokus ja aria-live-ilmoitus jokaisen muutoksen jälkeen. - Rivejä ei poisteta. Käytöstä poistetun yläkohdan alla olevat rivit säilyttävät oman tilansa, mutta eivät ole valittavissa. Nimi on yksilöllinen samalla tasolla kirjainkoosta riippumatta. - Työtehtävän voi siirtää saman yksikön toiseen palveluun tai suoraan yksikön alle. - Luvun 11.1 lista data-migraationa (0002_seed), jos taulut ovat tyhjiä. - CatalogQueries: work_type_options, active_service_units ja get_work_type tehtäviä ja tuntikirjausta varten. - Import-linter-sopimukset, suomennokset, yksikkö-, integraatio- ja selaintestit. - Päivitetty CLAUDE.md ja määrittelyn kohta 16.3. Co-Authored-By: Claude Opus 5.5 <[email protected]>
28 lines
1014 B
Python
28 lines
1014 B
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 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)."""
|
|
...
|