Skip to content
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
rubenvdlinde merged 1 commit into
developmentfrom
refactor/leges-to-manifest
May 11, 2026
Merged

refactor(legesberekening): adopt manifest pattern — schema CRUD via manifest, keep calc service#373
rubenvdlinde merged 1 commit into
developmentfrom
refactor/leges-to-manifest

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

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, reference
  • legesartikel — tariff line, scoped by verordening: nummer, omschrijving, type (vast | percentage | staffel | maximum | combinatie), grondslagField, bedrag, percentage, maximum, subType, brackets[], subArtikelen[], category, order
  • legesberekening — calculation result on a case: case, verordening, verordeningId, total, breakdown[], calculatedBy, calculatedAt, version, previousVersion, previousTotal, difference, correctionReason, status (concept/opgelegd/verrekend/teruggegeven), exportedAt, exportFormat

All three registered on the procest register — OpenRegister handles CRUD; no bespoke controllers.

Manifest pages added (src/manifest.json)

Page Route Type Schema
Legesverordeningen /legesverordeningen index legesverordening
LegesverordeningDetail /legesverordeningen/:id detail legesverordening (with Artikelen sub-index tab on legesartikel filtered by verordening)
Legesberekeningen /legesberekeningen index legesberekening
LegesberekeningDetail /legesberekeningen/:id detail legesberekening

Two new menu entries under the settings section (LegesverordeningenMenu, LegesberekeningenMenu).

Preserved (no change)

  • LegesController::calculate, recalculate, verrekening, teruggaaf, export — all five domain endpoints
  • LegesCalculationService (rules engine: vast / percentage / staffel / maximum / combinatie + verrekening + teruggaaf)
  • LegesExportService (CSV / XML / JSON export to financial system)
  • /api/leges/* routes in appinfo/routes.php

Deletions

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 files
  • node tests/validate-manifest.js — structural lint PASS, 21 pages
  • php -l on LegesController, LegesCalculationService, LegesExportService, appinfo/routes.php — clean
  • Smoke: install on Nextcloud dev, register seed creates the three new schemas
  • Manifest renderer surfaces Legesverordeningen + Legesberekeningen index/detail pages
  • POST /api/leges/calculate still works end-to-end

…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
@rubenvdlinde rubenvdlinde merged commit 1e02eea into development May 11, 2026
16 of 20 checks passed
@rubenvdlinde rubenvdlinde deleted the refactor/leges-to-manifest branch May 11, 2026 10:32
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 80ae34d

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant