Skip to content

feat(api): guest CSAT rating by token#85

Merged
mpge merged 1 commit into
mainfrom
feat/api-guest-csat
Jun 26, 2026
Merged

feat(api): guest CSAT rating by token#85
mpge merged 1 commit into
mainfrom
feat/api-guest-csat

Conversation

@mpge

@mpge mpge commented Jun 26, 2026

Copy link
Copy Markdown
Member

Adds guest CSAT — a guest can rate their own resolved/closed ticket via its guest token. (The satisfaction handler previously noted this as a follow-up pending a guest route group, which now exists from #81.)

What

  • POST /api/guest/tickets/{token}/rate — resolves the ticket by guest_token, then applies the same rating rules as the authenticated path (1–5 score, resolved/closed only, one rating per ticket).
  • Extracts the shared rating core into rateByTicketID; Rate (by id) and GuestRate (by token) both call it. Routes in both routers.

Verification

  • go build ./... clean; golangci-lint run0 issues.
  • New TestGuestRateFlow (real SQLite + migrations + ticket service): open ticket → 422, resolve → rate 201, re-rate → 422, unknown token → 404.
  • Full go test ./... passes.

Add POST /api/guest/tickets/{token}/rate so a guest can rate their own
resolved/closed ticket using its guest token. Extracts the shared rating
core (validation, rateable check, one-per-ticket guard, insert) from the
authenticated Rate handler into rateByTicketID; GuestRate resolves the
ticket by guest_token and reuses it. Routes registered in both routers.
@mpge mpge merged commit 810a5c0 into main Jun 26, 2026
2 checks passed
@mpge mpge deleted the feat/api-guest-csat branch June 26, 2026 20:49
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