This repository was archived by the owner on May 29, 2026. It is now read-only.
refactor(legesberekening): adopt manifest pattern — schema CRUD via manifest, keep calc service#373
Merged
Merged
Conversation
…anifest, keep calc service Aligns the legesberekening surface with the manifest renderer pattern established by procest-manifest-v1 (#320) and mirrored by the parafeerroute refactor: tariff and history CRUD is now declared in src/manifest.json against three OpenRegister schemas, while the domain logic in LegesCalculationService / LegesExportService and the non-CRUD endpoints (/api/leges/calculate, /recalculate, /verrekening, /teruggaaf, /export) remain untouched. Schemas (lib/Settings/procest_register.json) - legesverordening: municipal fee regulation (year, effectiveDate, status, isActive, globalMaximum, reference) - legesartikel: tariff line with type vast | percentage | staffel | maximum | combinatie, grondslagField, brackets, subArtikelen, category, order, scoped by verordening - legesberekening: per-case calculation result with breakdown, version history (version, previousVersion, previousTotal, difference, correctionReason), status concept | opgelegd | verrekend | teruggegeven, exportedAt + exportFormat All three are registered on the procest register so OpenRegister exposes the standard CRUD endpoints — no bespoke controllers needed. Manifest pages (src/manifest.json) - Legesverordeningen — index of regulations, columns name/year/ effectiveDate/status/isActive - LegesverordeningDetail — detail with sidebar tabs Overview, Artikelen (related-index on legesartikel filtered by verordening, with create/edit/delete), Audit trail - Legesberekeningen — index of calculation history, columns case/ verordening/total/version/status/calculatedBy/calculatedAt, read-only actions - LegesberekeningDetail — detail with Overview and Audit trail - Two new settings-section menu entries (Legesverordeningen at order 96, Legesberekeningen at order 97) Preserved - LegesController::calculate, recalculate, verrekening, teruggaaf, export — all five remain (domain endpoints, no CRUD proxying) - LegesCalculationService (vast / percentage / staffel / maximum / combinatie rules + verrekening + teruggaaf) — untouched - LegesExportService (CSV / XML / JSON export to financial system) — untouched - /api/leges/* routes in appinfo/routes.php — all five kept Deletions - None required. The pre-existing controller already exposes only domain endpoints; no CRUD methods, routes, or Vue views for leges tariffs / history existed prior to this change. Validation - jq parses both JSON files; new schemas + register list verified - node tests/validate-manifest.js — structural lint PASS, 21 pages - php -l on LegesController, LegesCalculationService, LegesExportService, appinfo/routes.php — no syntax errors
Contributor
Quality Report — ConductionNL/procest @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ❌ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ❌ | ||||
| composer | ✅ | ✅ 100/100 | |||
| npm | ✅ | ✅ 407/407 | |||
| PHPUnit | ⏭️ | ||||
| Newman | ⏭️ | ||||
| Playwright | ❌ |
Spec coverage: 3% (21 tests / 673 specs)
Quality workflow — 2026-05-11 10:45 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the legesberekening surface with the manifest renderer pattern (procest-manifest-v1, #320) and mirrors the parafeerroute refactor. Tariff configuration (legesverordening + legesartikel) and per-case calculation history (legesberekening) now live as OpenRegister schemas with CRUD declared in
src/manifest.json. The calculation/export domain logic stays exactly where it was.Changes
Schemas added (
lib/Settings/procest_register.json)legesverordening— municipal fee regulation:name,year,effectiveDate,endDate,status(concept/vastgesteld/vervallen),isActive,globalMaximum,referencelegesartikel— tariff line, scoped byverordening:nummer,omschrijving,type(vast|percentage|staffel|maximum|combinatie),grondslagField,bedrag,percentage,maximum,subType,brackets[],subArtikelen[],category,orderlegesberekening— calculation result on a case:case,verordening,verordeningId,total,breakdown[],calculatedBy,calculatedAt,version,previousVersion,previousTotal,difference,correctionReason,status(concept/opgelegd/verrekend/teruggegeven),exportedAt,exportFormatAll three registered on the
procestregister — OpenRegister handles CRUD; no bespoke controllers.Manifest pages added (
src/manifest.json)Legesverordeningen/legesverordeningenLegesverordeningDetail/legesverordeningen/:idLegesberekeningen/legesberekeningenLegesberekeningDetail/legesberekeningen/:idTwo new menu entries under the settings section (
LegesverordeningenMenu,LegesberekeningenMenu).Preserved (no change)
LegesController::calculate,recalculate,verrekening,teruggaaf,export— all five domain endpointsLegesCalculationService(rules engine: vast / percentage / staffel / maximum / combinatie + verrekening + teruggaaf)LegesExportService(CSV / XML / JSON export to financial system)/api/leges/*routes inappinfo/routes.phpDeletions
None required. The pre-existing controller already exposes only domain endpoints — no CRUD methods, no CRUD routes, no Vue list/detail views for leges tariff or history existed prior to this change.
Test plan
jq -e .parses both modified JSON filesnode tests/validate-manifest.js— structural lint PASS, 21 pagesphp -lon LegesController, LegesCalculationService, LegesExportService, appinfo/routes.php — cleanPOST /api/leges/calculatestill works end-to-end