Skip to content

feat(support-issue): customer close + InProgress status, list filters & InClarification#3950

Open
joshuakrueger-dfx wants to merge 7 commits into
developfrom
fix/support-issue-list-filters
Open

feat(support-issue): customer close + InProgress status, list filters & InClarification#3950
joshuakrueger-dfx wants to merge 7 commits into
developfrom
fix/support-issue-list-filters

Conversation

@joshuakrueger-dfx

Copy link
Copy Markdown
Collaborator

Summary

Customer- and staff-facing improvements to the support-issue module — ticket lifecycle transparency and back-office list tooling.

Customer

  • Close own ticket — new PUT /support/issue/:id/close (OptionalJwtAuthGuard, ownership via getIssueSearch). Sets state to Completed, idempotent on already-closed issues, non-destructive (a new message reopens the ticket via the existing createMessageInternal flow).
  • InProgress status — new customer-visible SupportIssueState.IN_PROGRESS. Previously Created/Pending/OnHold all collapsed to Pending, so a customer could not tell "queued" from "actively being worked on". Now distinguishable.
  • InClarification status — customer-visible SupportIssueState.IN_CLARIFICATION ("in internal clarification").

Staff

  • No new endpoint needed: the existing PUT /support/issue/:id (RoleGuard(SUPPORT)) already accepts the full SupportIssueInternalState enum, so staff can set InProgress and InClarification out of the box.
  • List filters on GET /support/issue/list: clerk, createdFrom/createdTo, plus whitelisted orderBy/orderDir sorting.

State model

Internal Customer-visible
Created, Pending, OnHold Pending
InProgress (new) InProgress (new)
InClarification InClarification
Completed / Canceled Completed / Canceled

SupportIssueStateMapper stays exhaustive ([key in SupportIssueInternalState]) — the compiler enforces a mapping for every internal state.

Tests

  • support-issue-state.mapper.spec.ts — every internal state maps to a valid customer state; InProgress and InClarification explicitly asserted.
  • support-issue.service.spec.ts — list filters.
  • Full unit suite: 1068 passed, 0 failed. tsc: 0 errors. lint: clean.

Notes

  • The staff admin UI dropdown lives in DFXswiss/services (separate repo) — the new statuses must be added there as selectable options; this PR is API + enum only.
  • Frontend DFXswiss/services / wallet already render InProgress (badge color present); no API-side change required for that.

…ion state

Extend GET /support/issue/list with clerk, createdFrom/createdTo
filters and whitelisted orderBy/orderDir sorting. Add customer-visible
SupportIssueInternalState.IN_CLARIFICATION mapped to SupportIssueState
.IN_CLARIFICATION so customers see 'in internal clarification'.
Add PUT /support/issue/:id/close so customers can close their own
issue; idempotent on already-closed issues.
…ping

Add DB-free unit tests for getSupportIssueList query building (clerk
filter, createdFrom/createdTo bounds, whitelisted orderBy with id
tie-break) and exhaustive SupportIssueStateMapper coverage incl. the
new customer-visible InClarification state.
Add SupportIssueInternalState.IN_PROGRESS mapped 1:1 to
SupportIssueState.IN_PROGRESS so customers can distinguish a ticket that
is actively being worked on from one still queued (Pending). Staff set it
via the existing PUT /support/issue/:id endpoint.
…, return full thread, inclusive createdTo

- closeIssue: log via SupportLogType.CUSTOMER (was SUPPORT, mislabeled the actor)
- closeIssue: load messages so the response matches GET /:id instead of an empty thread
- list: a date-only createdTo now includes the whole day (end-of-day bound)
- add SupportIssueService.closeIssue tests (not-found, owner scoping, completion+log, idempotency, message loading)
@joshuakrueger-dfx

Copy link
Copy Markdown
Collaborator Author

Review round (TaprootFreak)

  • Tests for closeIssue — not-found, owner-scoped lookup, completion + customer log, idempotency, message loading.
  • Log type — customer close now logged as SupportLogType.CUSTOMER (was SUPPORT, mislabeled the actor).
  • Response contractcloseIssue loads messages so the response matches GET /:id instead of returning an empty thread.
  • createdTo — a date-only bound now includes the whole day (end-of-day), fixing the off-by-one.
  • UID auth (decided) — keep the issue UID as a capability token (consistent with get/message/file; required for anonymous transaction-request issues); documented explicitly in getIssueSearch.

Deferred (product calls, not blockers): auto-transition to InProgress on first clerk reply; notify the assigned clerk on customer close.

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