Skip to content

feat: add per-user behavior override UI and endpoint (#452)#7

Merged
rogeriolino merged 2 commits into
v2.3from
feat/issue-452-user-behavior-settings
Mar 21, 2026
Merged

feat: add per-user behavior override UI and endpoint (#452)#7
rogeriolino merged 2 commits into
v2.3from
feat/issue-452-user-behavior-settings

Conversation

@rogeriolino
Copy link
Copy Markdown
Member

@rogeriolino rogeriolino commented Mar 20, 2026

Issue: novosga/novosga#452

Summary

  • New DTO UpdateUsuarioBehaviorDto with ?bool $callTicketByService and ?bool $callTicketOutOfOrder
  • DefaultController::index(): injects ApplicationSettingsServiceInterface and UsuarioMetadataRepositoryInterface; appends behavior key (with nullable overrides) to each user's data array; passes globalBehavior to the template
  • New endpoint PUT /usuario/{id}/behavior: validates payload via MapRequestPayload, calls saveUserBehaviorSettings()
  • Template: new behavior card in tab-atendimento with dropdowns for callTicketByService and callTicketOutOfOrder; the null option label shows the effective global value
  • JS: new updateUsuarioBehavior(usuario) method
  • Translations: label.yes, label.no, settings.user.behavior, settings.user.call_ticket_by_service, settings.user.call_ticket_out_of_order, settings.user.use_global added for en, en_US, es, es_AR, pt_BR, pt_PT

Part of #452 — see also PRs in core, novosga, and attendance-bundle.

Test plan

  • Open /admin → tab Atendimento → select a user
  • Two behavior dropdowns appear, defaulting to the global value option
  • Change a dropdown → PUT /usuario/{id}/behavior fires and returns 200
  • Reload page → override persists
  • Reset to null → reverts to global behavior

🤖 Generated with Claude Code

@rogeriolino rogeriolino force-pushed the feat/issue-452-user-behavior-settings branch 2 times, most recently from 628c0e1 to abbbc00 Compare March 20, 2026 13:50
- New UpdateUsuarioBehaviorDto for PUT /usuario/{id}/behavior
- DefaultController: inject settings service and usuario metadata
  repository; expose behavior overrides per user in index(); add
  updateUsuarioBehavior() endpoint
- Template: behavior card with dropdowns for callTicketByService and
  callTicketOutOfOrder (null = inherit global)
- JS: updateUsuarioBehavior() method calling the new PUT endpoint
- Translations: add label.yes, label.no, settings.user.behavior,
  settings.user.call_ticket_by_service,
  settings.user.call_ticket_out_of_order, settings.user.use_global
  for en, en_US, es, es_AR, pt_BR, pt_PT

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rogeriolino rogeriolino force-pushed the feat/issue-452-user-behavior-settings branch from abbbc00 to fe995b4 Compare March 20, 2026 14:19
@rogeriolino rogeriolino merged commit 5375f8b into v2.3 Mar 21, 2026
1 check passed
@rogeriolino rogeriolino deleted the feat/issue-452-user-behavior-settings branch March 21, 2026 14:35
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