Skip to content

feat(larpinq): build events-casting-and-crew-roles - #1054

Open
rubenvdlinde wants to merge 15 commits into
developmentfrom
quality/build-events-casting-and-crew-roles
Open

rubenvdlinde wants to merge 15 commits into
developmentfrom
quality/build-events-casting-and-crew-roles

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Builds openspec/changes/events-casting-and-crew-roles, covering the matrix rows chr-casting-preferences and evt-crew-roles: players rank the characters open for casting, larpinq proposes the best overall casting, game masters confirm it, and volunteers fill crew and NPC roles. Everything that can be done in code and unit tests is built; what is left needs a running instance.

Tasks done

  • 1.1 The fragment register.d/events-casting-and-crew-roles.json: character.castingEvent, event.castingDeadline, castingPreference, crewRole and crewAssignment, with their access rules. Every field now has a description.
    • The casting deadline is a write rule. CastingPreferenceGuard, applied by CastingPreferenceListener on OpenRegister's pre-write events for the preference schema, refuses a player's ranking from the deadline on. It also refuses a ranking on someone else's registration or another event's registration, of a character not open on the event, or of a sixth character. Game masters and system writes pass.
  • 1.2 The Winter Court seed in larpinq_mock_register.json: a casting deadline of 1 November 2026; The Chancellor, The Spy, The Heir and The Bard open for casting; the rankings of Anna, Pieter and Sanne; Bandits, Kitchen and Healers; Joris in the Kitchen and Lotte in two NPC roles. Every new schema has three demo objects.
  • 2.1, 2.2 (earlier on this branch) CastingSolver, CastingService and CastingController.
  • 3.1 Two registered sections, set up in the manifest:
    • EventCasting.vue, the Casting tab on the event page (src/manifest.json). It shows how often each open character was ranked at each rank and the proposal as a table the game master edits; giving a character to one player takes it from another. It has Confirm casting, which names the refused pairs. It also lists the crew and NPC roles with "{filled} of {places} places filled" and an assign action for accepted registrations with a crew or NPC ticket.
    • RegistrationCasting.vue, the Casting tab on the registration page, reached from My registrations (tab added in place in src/manifest.d/registration-intake-and-capacity.json). The player ranks up to five characters until the deadline and sees their own crew roles.
    • Data goes through the OpenRegister objects API; only the proposal and confirm come from larpinq. The pages use the shared CnDataTable and NcSelect with inputLabel, and CSS variables only.
  • 4.1 (earlier) plus the new UI and schema strings (34 keys), translated in en and all 36 locales. They are inserted beside the other casting strings, not at the end of the file. l10n:build only touched those keys.
  • 4.2 docs/features/casting-and-crew.md is rewritten for game masters and players, and listed in docs/features/README.md beside the event features.

Tasks left, and why

  • 3.2 The Playwright journey tests/e2e/event-casting.spec.ts needs a running Nextcloud with players; it is not written or run here.
  • Live checks inside ticked tasks were not run either: the Newman check that a player reads only their own preferences (1.1), importing the seed on an instance (1.2), and the docs build (4.2). They need a running instance or the docs toolchain.

Tests added

  • CastingPreferenceGuardTest (8): deadline boundaries, no deadline, game masters and system writes, own registration only, open characters only, unknown event, five-ranking cap with re-ranking.
  • CastingPreferenceListenerTest (3): the real OpenRegister events and the real guard. Create and update are refused after the deadline; other schemas, no user and other events pass.
  • CastingSeedTest (3): the seed validates against the merged schemas with Opis, holds the design's cast and crew, and the real CastingService and CastingSolver propose Anna The Heir, Pieter The Bard and Sanne The Spy over it.
  • tests/vitest/eventCasting.spec.js (13): proposal and confirm requests, crew places and volunteers, deadline, rank validation, ranking writes (delete, then patch, then post, stopping at a refusal), the registration read.
  • tests/vitest/eventCastingView.spec.js (10): the proposal table rows and rank counts, one player per character, confirm and reload, refused pairs, a player refused, assigning Joris to the Kitchen, and Anna's ranking (load, save, duplicate rank, after the deadline).
  • Updated: the listener registration order tests, the seed status test (now checks each status is present), and the effective manifest golden hashes for EventDetail and RegistrationDetail.

Suite before and after

  • PHPUnit (phpunit-unit.xml): 856 tests, 20 skipped, before; 870 tests, 20 skipped, after. No failures.
  • vitest: 548 before, 571 after, all green.

Other checks

  • php -l, phpcs, phpstan, psalm and phpmd are clean on the new PHP files. phpmd only reports the same static access to PreWriteEvent that every listener has.
  • eslint and prettier are clean on the new JS and Vue files.
  • check:register, check:manifest, check:schema-l10n (baseline 84), test:l10n and check:l10n-js are green.
  • Hydra gates: 9 fail. None names a file of this change: composer-audit, no-admin-idor (PreferencesController, RegistrationChangesController), manifest-validation and effective-manifest-crossref (/setup/steps/1), e2e-networkidle (tests/e2e/phone/overflow.spec.ts), icon-vocabulary (CardAccountDetailsOutline), apphost-autoload-prelude, reports-one-page and app-chrome. Spec coverage, schema property titles and demo data coverage passed after the fixes in this PR.

Generated by Claude Code

The fragment adds characters open for casting, a casting deadline, ranked
casting preferences readable by game masters and the player only, crew
and NPC roles and crew assignments. CastingSolver finds the best overall
casting with the Hungarian method: the most ranked matches, then the
lowest total rank, then the most first choices, then earlier sign-ups.
CastingService proposes it without writing and confirms the pairs a game
master keeps through ordinary object writes. CastingController serves
both to game masters only. The 15 new schema strings are translated in
every locale, and the browser catalogues are rebuilt from l10n/*.json.

Assisted-by: ClaudeCode:claude-opus-5-5
…oles [skip ci]

Assisted-by: ClaudeCode:claude-opus-5-5
…end so it merges beside sibling changes [skip ci]

Assisted-by: ClaudeCode:claude-opus-5-5
Hold the casting deadline on every write of a ranking: a player ranks only
on their own registration for the event, only characters open for casting
on it, at most five, and not from the deadline on. Game masters pass.

Assisted-by: ClaudeCode:claude-opus-5-5
Seed the Winter Court casting and crew: a casting deadline, four characters
open for casting, the rankings of Anna, Pieter and Sanne, the Bandits and
Kitchen roles, and Joris in the Kitchen. A test validates the seed against
the merged schemas and proposes the casting design.md names over it.

Assisted-by: ClaudeCode:claude-opus-5-5
Add the Casting tab on the event page: how often each open character was
ranked at each rank, the proposal as a table the game master edits and
confirms, and the crew and NPC roles with filled and open places and an
assign action for volunteers with a crew or NPC ticket. A Casting tab on
the registration page, reached from My registrations, lets the player
rank up to five characters until the casting deadline and shows their
crew roles. Both are registered sections; the strings are translated in
every locale next to the other casting strings.

Assisted-by: ClaudeCode:claude-opus-5-5
Describe the Casting tabs for game masters and players, the casting
deadline, the crew roles and the example data, and list the feature
beside the other event features.

Assisted-by: ClaudeCode:claude-opus-5-5
…[skip ci]

Give each new casting and crew field a description, translated in every
locale beside the other casting strings; seed a third crew role and two
more assignments so every new schema has three demo objects; and tag the
casting tabs' helpers with the change's spec.

Assisted-by: ClaudeCode:claude-opus-5-5
Name the third crew role and Lotte's assignments in the example data.

Assisted-by: ClaudeCode:claude-opus-5-5
…oles [skip ci]

Assisted-by: ClaudeCode:claude-opus-5-5
…kip ci]

Routes, settings keys, manifest tabs, the mock register and openapi.json
keep both sides; the settings count test covers all 26 slugs (79 keys)
and the effective-manifest golden is regenerated from the merged
manifest (only EventDetail and RegistrationDetail differ from
development, as on the branch).

Assisted-by: ClaudeCode:claude-opus-5-5
… references [skip ci]

The casting seed points at registrations by position; development's new
registrations now follow them, so both sides' seeds resolve.

Assisted-by: ClaudeCode:claude-opus-5-5
Task 3.2 names tests/e2e/event-casting.spec.ts; it did not exist. On
the design.md seed: Anna, Pieter and Sanne rank on their registrations,
a player is refused the proposal, and the game master confirms so The
Heir goes to Anna and her registration names it.

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

Copy link
Copy Markdown
Contributor Author

Added tests/e2e/event-casting.spec.ts (task 3.2, 3 tests on the design.md seed) in 0d13d8e; the Playwright run still needs a live instance.


Generated by Claude Code

…kip ci]

Keep both sides' seed objects in the mock register (casting/crew from
this branch, help desk from development) and count all 28 slugs in
SettingsServiceTest (85 config keys).

Assisted-by: ClaudeCode:claude-opus-5-5
…gs cannot be read [skip ci]

The five-ranking limit counted an unreadable list as empty and let the
write through; it now counts it as full, as the guard's other reads
already refuse when they fail.

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