Issue #3621578: Seed the example allocations under the field names the entity declares

A slot tariff names the tariff it provisions and carries a quota. Both example seeds wrote those as category and capacity, which create() drops without complaining, so the rows existed with neither field set. The placement demo's concert priced nothing, and the workflow demo's per-tariff caps were never enforced, because a booking falls back to the slot's own capacity when no allocation matches.

The sweep found the same keys in both examples, so both are fixed here rather than only the one the issue names. The locals that fed them are renamed to match the fields, since a local called $category feeding a field called tariff is what let the original rename miss them.

The state manifest keys are deliberately left alone: uninstall reads them to find what to delete, so renaming them would strand the rows of an existing install.

Test coverage

Counting rows is what let this pass unnoticed - both seeds produced the expected number of allocations either way - so neither test counts alone now. The placement seed's existing test asserts each allocation names its tariff, carries its quota and satisfies its own constraints, folded into the existing install so the class still pays for one. The workflow example is asked as counts in setUp(), which already reads the seed, rather than as another test method: that class shares one site install across its scenarios by design, and a new method would have added a whole site install.

Verified

Rebased onto 1.x after !338 (merged) and !336 (merged) merged, and re-verified there rather than trusting the clean rebase: PlacementExampleTest passes (42 assertions), and the workflow example installs with 9 of 9 manager grants (from !338 (merged)) alongside 56 allocations with no missing tariff or quota, so the two fixes coexist. phpcs, phpstan and cspell are all clean, and the tree-wide sweep now finds no remaining slot tariff written under the retired names.

AI-Generated: Yes (Claude Code was used to help draft this merge request and to write the fix and its tests. I reviewed the work and ran both seeds against a real site before posting.)

Edited by Frank Mably

Merge request reports

Loading
Loading