feat(admin): public-ticket guest policy settings endpoints (Task 6.3)#32
Open
feat(admin): public-ticket guest policy settings endpoints (Task 6.3)#32
Conversation
3 tasks
Adds GET + PUT /support/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 .NET greenfield host adapter. - Three keys back the policy: guest_policy_mode (unassigned | guest_user | prompt_signup), guest_policy_user_id, and guest_policy_signup_url_template. Consumers (widget controller, inbound router) read via SettingsService so mode switches don't require a redeploy. - PUT validates the mode against the known enum (falls back to unassigned for unknown values), clears mode-specific fields on switch to prevent stale guest_user_id leaking into prompt_signup behavior, and truncates signup URL templates at 500 chars. - PublicTicketsSettingsRequest record uses snake_case JsonPropertyName attributes to match the wire format the shared Vue page sends (consistent with the Symfony port in escalated-symfony/feat/settings-service). - 8 xUnit tests exercise round-trip read-after-write, mode-switch cleanup, unknown-mode coercion, truncation, zero-user-id handling, and multi-update consistency. Existing .NET had SettingsService + EscalatedSettings model already; this PR only adds the two public-tickets endpoints + tests on top. No migration or schema changes needed.
bab5559 to
18f046f
Compare
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 /support/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 .NET greenfield host adapter.
The existing `SettingsService` + `EscalatedSettings` model already provide the key/value backbone — this PR only adds the two public-tickets endpoints + tests on top. No migration or schema changes needed.
What's added
Three settings keys back the policy:
Consumers (widget controller, inbound router) read via `SettingsService.GetAsync` so mode switches don't require a redeploy.
Validation + cleanup semantics
Wire format
`PublicTicketsSettingsRequest` uses `[JsonPropertyName]` snake_case attributes so the wire format matches what the shared Vue page sends — consistent with the Symfony port (`escalated-symfony/feat/settings-service`).
Test plan
8 xUnit tests in `PublicTicketsSettingsTests`:
Follow-ups (per other frameworks in the rollout)