Skip to content

🐛: fix(api): aceita membro pendente na edição de plantão e nas trocas - #138

Merged
diovanibmotta merged 3 commits into
feat/microkernel-pluginsfrom
fix/pending-members-shift-edit
Dec 3, 2026
Merged

diovanibmotta merged 3 commits into
feat/microkernel-pluginsfrom
fix/pending-members-shift-edit

Conversation

@diovanibmotta

Copy link
Copy Markdown
Collaborator

Resumo

  • Com includePendingMembers ligado, trocar o responsável de um plantão para membro com convite pendente retornava "Usuário não encontrado": o PATCH só aceitava accepted.
  • Mesma falha em createSwap (colega pendente) e na elegibilidade das trocas.
  • validateAssignment não emite mais o aviso falso user_not_in_rotation para pendente com o parâmetro ligado.
  • Novo GET /users/assignable (gestor): membros da equipe ativa, só aceitos ou, com o parâmetro, também pendentes. O seletor de responsável (ShiftEditForm) passa a usá-lo em vez de /users, que listava todos os usuários do sistema. O responsável atual continua visível.
  • Com o parâmetro desligado, só aceitos são aceitos e listados.

Testes

  • Novos casos em publish.test.ts, swaps.test.ts, users.test.ts e ScheduleAdminPage.test.tsx.
  • typecheck, lint e testes de schedules, swaps, parameters, users e schedule-admin passam.

🤖 Generated with Claude Code

diovanibmotta and others added 2 commits December 3, 2026 11:56
- PATCH /schedules/:id/shifts/:shiftId e createSwap só aceitavam status accepted
- com includePendingMembers, convite pendente passa a ser válido e conta no rodízio
- testes cobrem recusa por padrão e aceite com o parâmetro ligado

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- novo GET /users/assignable: aceitos e, com includePendingMembers, pendentes
- ShiftEditForm usa o endpoint em vez de listar todos os usuários do sistema
- responsável atual continua visível mesmo se deixou de ser elegível

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@diovanibmotta diovanibmotta added the bug Something isn't working label Dec 3, 2026
@diovanibmotta diovanibmotta self-assigned this Dec 3, 2026
@diovanibmotta diovanibmotta added this to the Microkernel / Plugins milestone Dec 3, 2026
- edit.ts: mantém requirePermission da base e getTeamParameters
- GET /users/assignable passa a exigir a permissão schedule:edit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@diovanibmotta
diovanibmotta marked this pull request as ready for review December 3, 2026 16:14
@diovanibmotta
diovanibmotta merged commit 7b6a057 into feat/microkernel-plugins Dec 3, 2026
5 checks passed
@diovanibmotta
diovanibmotta deleted the fix/pending-members-shift-edit branch December 3, 2026 16:17
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0-rc.19 🎉

The release is available on:

  • npm package (@rc dist-tag)
  • npm package (@rc dist-tag)
  • npm package (@rc dist-tag)
  • npm package (@rc dist-tag)
  • GitHub release

Your semantic-release bot 📦🚀

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

Labels

bug Something isn't working released on @rc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant