feat(admin): public-ticket guest policy settings endpoints (Task 6.3)#36
Open
feat(admin): public-ticket guest policy settings endpoints (Task 6.3)#36
Conversation
Adds GET + PUT /escalated/api/admin/settings/public-tickets so admins
can switch the public-ticket guest-policy mode at runtime via the
shared Admin/Settings/PublicTickets.vue page. Closes Plan Task 6.3 for
the Spring greenfield host adapter.
Spring already had SettingsService + EscalatedSettings + repo from an
earlier PR, so this is a pure controller-layer add — no migration or
schema changes needed.
Three guest-policy keys back the policy (same shape as the Symfony,
.NET, and Go ports):
- guest_policy_mode ∈ { unassigned, guest_user, prompt_signup }
- guest_policy_user_id (required for guest_user)
- guest_policy_signup_url_template (optional for prompt_signup, ≤500
chars)
All three are stored under the "public_tickets" settings group.
Handler semantics match the rest of the rollout:
- Unknown mode values coerce to "unassigned" (never 500s on bad input)
- Mode switch clears fields that don't apply to the new mode
- Zero/negative/non-numeric user_id surfaces as JSON null on GET
- Signup URL templates are trimmed + truncated to 500 chars
PublicTicketsSettingsRequest record uses @JsonProperty snake_case
attributes to match the wire format the shared Vue page sends.
8 MockMvc tests cover: defaults-when-empty, guest_user + prompt_signup
happy paths (with cross-mode cleanup), unknown-mode coercion, 500-char
truncation, zero user_id handling, mode-switch cleanup edge case, and
multi-write read-after-write consistency.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds `GET` + `PUT /escalated/api/admin/settings/public-tickets` so admins can switch the public-ticket guest-policy mode at runtime via the shared `Admin/Settings/PublicTickets.vue` page. Closes Plan Task 6.3 for the Spring greenfield host adapter.
Spring already had `SettingsService` + `EscalatedSettings` + repository from an earlier PR, so this is a pure controller-layer add — no migration or schema changes needed.
What's added
Three guest-policy keys under the `public_tickets` settings group:
Handler semantics match the rest of the rollout (Symfony / .NET / Go):
`PublicTicketsSettingsRequest` record uses `@JsonProperty` snake_case attributes so the wire format matches what the shared Vue page sends.
Test plan
Follow-ups