3.1 KiB
Customer and project catalog
Names are trimmed, nonempty and at most 200 characters. Case-insensitive equality is enforced by H2-generated lower-case name keys and unique indexes: customers per owner, projects per customer. Display spelling is preserved. Archived records still reserve their names.
Owner-serialized transactions protect concurrent creation. Every rename/archive/restore checks both ownership and the previously loaded version. Existing work retains its stable customer/project references, so renaming changes historical display without changing recorded hours. Archiving a customer also excludes its projects from new-entry selection; restoring does not implicitly restore individually archived projects.
The reusable CatalogPicker offers searchable dependent comboboxes and separate explicit Create buttons. Merely typing never inserts a record. Customer changes clear incompatible project selection. Maintenance includes archived entries; new work selection excludes them. A persisted last-used pair is prepared for the work service to update only alongside successful work storage; inactive pairs are not preselected.
The maintenance view provides name changes, archival/restoration and stale-version feedback preserving the unsaved input. Reload refreshes the selected records.
Local validation: four service tests cover normalized names, independent owner/customer scopes, database-level duplicate rejection, simultaneous creation, stable historical references, archival/restoration, stale versions and last-used pair eligibility. Browser checks cover explicit customer/project creation, archival/restoration and conflicting customer edits. Name fields synchronize eagerly; browser testing confirmed immediate rename display and retained conflicting input. All 33 JVM tests and the production JAR smoke passed. Werkator independently passed revision aec192f in 123 seconds.
Management redesign
The catalog management route now has a customer list and a project list for the selected customer. Creation and editing use dialogs; the Work route retains its existing comboboxes. The edit dialog also allows archiving/restoring records. Customer deletion now requires a checkbox and explicit confirmation and removes all associated projects and work entries atomically. The dialog explains this scope. Individual projects referenced by work entries must still be archived instead. Mutations retain owner isolation, version checks and transactional protection; deleting a preferred project clears the last-used pair.
Regression tests cover deletion of unused records, stale delete versions, owner isolation, referenced-entry rejection and preference cleanup.
The redesigned view was checked locally at 1200px desktop and 390px smartphone widths: side-by-side/stacked lists, responsive icon actions, customer/project creation, project rename, confirmation and deletion of unused records, and rejection of deleting a booked project. Dialogs close after successful mutations and display a single heading. Browser error log was empty. Targeted CatalogServiceTest and the production build passed.