Skip to content

feat(squads): PromoteToSubCaptain / demote (#358) - #501

Open
guisaliba wants to merge 1 commit into
feat/squadsfrom
story/358-promote-to-sub-captain
Open

feat(squads): PromoteToSubCaptain / demote (#358)#501
guisaliba wants to merge 1 commit into
feat/squadsfrom
story/358-promote-to-sub-captain

Conversation

@guisaliba

Copy link
Copy Markdown

Closes #358

Parent: #342

What changed

  • Added PromoteToSubCaptain with handle() and demote() methods.
  • Added SquadPolicy authorization for captains, sub-captains, and super-admins.
  • Added transactional, locked role changes with append-only membership events.
  • Added idempotent same-state no-ops.
  • Added direct captain -> sub-captain and captain -> member transitions for off-platform election and succession outcomes.
  • Added feature coverage for authorization, inactive memberships, self-actions, vacancies, and event details.

Event scope

The existing promote and demote event values remain unchanged. from_role and to_role identify each transition. AssignCaptain remains responsible for assigning a captain; this action records the downward role changes.

Verification

  • vendor/bin/pest --compact app-modules/squads/tests/Feature/PromoteToSubCaptainTest.php
  • vendor/bin/pest --compact app-modules/squads/tests
  • make test
  • make test-pint
  • make test-rector
  • make phpstan

All checks pass.

@guisaliba
guisaliba requested a review from a team August 18, 2026 16:19
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