Skip to content

feat(shillinq): build budget-known-costs - #3178

Open
rubenvdlinde wants to merge 1 commit into
developmentfrom
quality/build-budget-known-costs
Open

rubenvdlinde wants to merge 1 commit into
developmentfrom
quality/build-budget-known-costs

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Round 2 build of openspec/changes/budget-known-costs. Design §12 says the change ships an operator-triggered run, but nothing called KnownCostBudgetWriter::run(): no route, no job and no button. The live e2e pass skipped 3 of its 4 tests for that reason ("KnownCostBudgetWriter has not run for the administration").

Tasks done

  • Entry point for the run (added to tasks.md group 7, ticked):
    • POST /api/v1/budgets/known-costs/regenerate (KnownCostController::regenerate, #[NoAdminRequired]): runs the writer for the administrationId given, or the caller's active administration. The caller must be allowed to post in that administration; anyone else gets a masked 404, an anonymous caller a 401, and a failed run a generic 500 that is logged. Documented in openapi.json (tag known-cost).
    • A "Regenerate known costs" header action on Budget Line Derivations (openRegenerateKnownCosts in src/manifestActions.js) opens src/modals/RegenerateKnownCostsModal.vue. The dialog shows how many lines were created and updated, how many were left alone because they had been changed by hand, and which fiscal years were skipped for lack of a default budget.
    • en and nl strings added to l10n/*.json and the .js rebuilt.
  • e2e: tests/e2e/budget-known-costs.spec.ts now opens with a test that runs the regeneration through the dialog, checks the 200 summary and the text it renders, and goes first so the existing row tests can find derived lines.

Tasks left, and why

  • npx playwright test tests/e2e/budget-known-costs.spec.ts against a live instance is not run here; no instance is reachable.

Tests

  • KnownCostControllerTest: 3 tests, 11 assertions. Inverting the access check fails all 3.
  • tests/vitest/knownCosts.spec.js: 8 tests. A deliberate break of the summary logic is caught.
  • PHP unit suite: 12796 before, 12799 after, both with 0 failures (3 skipped).
  • vitest suite: 3104 tests with 1 failure, dunningNextRun.spec.js "switches it on by the property the job reads". It fails the same way on development.
  • Gates: check-l10n, l10n-parity, dutch-tokens, check:l10n-js, validate-manifest and validate-manifest-shell pass.
    • phpcs: the controller is clean, and routes.php stays at its baseline count.
    • phpstan: no errors.
    • eslint and stylelint are clean on the touched files.
    • Failing on development already: check:manifest-budget (over its budget before this PR; this fragment adds 343 B) and check:nav-reachability (CustomRecords).

Generated by Claude Code

Round 2: the operator-triggered run design.md §12 promises had no entry
point; nothing called KnownCostBudgetWriter::run(), so the live e2e pass
found no derived budget line to show.

- POST /api/v1/budgets/known-costs/regenerate (KnownCostController): runs
  the writer for the named or active administration; the caller must be
  allowed to post in it, anyone else gets a masked 404. In openapi.json.
- "Regenerate known costs" header action on Budget Line Derivations opens
  RegenerateKnownCostsModal, which shows created / updated / overridden
  counts and the fiscal years skipped for want of a default budget.
- Tests: KnownCostControllerTest (3), tests/vitest/knownCosts.spec.js (8),
  and an e2e test that runs it through the dialog first.
- en/nl strings added and the l10n .js rebuilt.

Assisted-by: ClaudeCode:claude-opus-5-5

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant