Add catalog module for service units, services and work types
Phase 1, item 3: the hierarchy customer jobs, tasks and time entries will refer to. - New Catalog module: service unit > optional service > work type. Names are unique per level (case-insensitive); items are never deleted, only deactivated, and foreign keys restrict deletes. - Pohjatiedot page (/catalog, admins and management): add, rename, reorder with move up/down buttons (keyboard-friendly, focus kept and announced) and an "in use" checkbox per row. Work types can move to another service of the same unit. - A migration inserts the starting catalog from the specification when the tables are empty, so every installation has it. - CatalogQueries gives other modules the active service units and the work types of chosen units plus the shared ones. - Spec and CLAUDE.md updated. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+7
-5
@@ -316,9 +316,10 @@ Taulut ja tärkeimmät sarakkeet. Kaikissa tauluissa on `id` ja `created_at`/`up
|
||||
- `billing_units`: `customer_id`, `name`, `billing_address`, `e_invoice_address`, `e_invoice_operator`, `reference` *(olemassa)*
|
||||
|
||||
**Catalog** (palveluyksiköt ja hinnasto)
|
||||
- `service_units`: `name`, `sort_order`, `is_shared` (kaikille yhteiset)
|
||||
- `services`: `service_unit_id`, `name`, `sort_order`
|
||||
- `work_types`: `service_unit_id`, `service_id` (nullable), `name`, `hourly_rate_cents` *(V2)*, `sort_order`, `is_active`
|
||||
- `service_units`: `name`, `is_shared` (kaikille yhteiset), `is_active`, `sort_order` *(olemassa)*
|
||||
- `services`: `service_unit_id`, `name`, `is_active`, `sort_order` *(olemassa)*
|
||||
- `work_types`: `service_unit_id`, `service_id` (nullable), `name`, `is_active`, `sort_order` *(olemassa)*, `hourly_rate_cents` *(V2)*
|
||||
- Nimi on yksilöllinen saman tason sisällä (kirjainkoosta riippumatta). Rivejä ei poisteta, vaan ne poistetaan käytöstä; viiteavaimet estävät poiston.
|
||||
- `products` *(V2)*: `name`, `unit`, `price_cents`, `is_consumer_product`, `auto_hours`, `work_type_id`, `is_active`
|
||||
- `settings` *(V2)*: `key`, `value` (esim. km-hinta, työajanseuranta päällä)
|
||||
|
||||
@@ -393,8 +394,9 @@ Jokainen sivu täyttää saavutettavuusvaatimukset ja saa selaintestin (vaalea/t
|
||||
- Sisäinen asiakas on merkitty, eikä sitä voi poistaa.
|
||||
|
||||
### 16.3 Pohjatiedot
|
||||
- Pääkäyttäjä ja johto voivat lisätä, nimetä uudelleen, järjestää ja poistaa käytöstä palveluyksiköitä, palveluita ja työtehtäviä. Käytössä olleita ei poisteta, vaan ne poistetaan käytöstä.
|
||||
- Luvun 11.1 lista luodaan siemendatana.
|
||||
- Pääkäyttäjä ja johto voivat lisätä, nimetä uudelleen, järjestää ja poistaa käytöstä palveluyksiköitä, palveluita ja työtehtäviä Pohjatiedot-sivulla *(valmis)*. Käytössä olleita ei poisteta, vaan ne poistetaan käytöstä. Järjestys muutetaan Siirrä ylös / Siirrä alas -painikkeilla (toimii näppäimistöllä).
|
||||
- Työtehtävän voi siirtää toiseen saman yksikön palveluun tai suoraan yksikön alle.
|
||||
- Luvun 11.1 lista lisätään migraatiossa, jos taulut ovat tyhjiä *(valmis)*.
|
||||
|
||||
### 16.4 Asiakastyöt
|
||||
- Työntekijä voi luoda ja muokata asiakastöitä; alihankkija ei.
|
||||
|
||||
Reference in New Issue
Block a user