Skip to content

PRD: Helpdesk core (tickets, SLA, agents)

ModuleHelpdesk (CORE-13)PRD IDPRD-TKT-001
StatusIn-progressOwnerHelpdesk squad
Date2026-06-02Versionv0.1
Packages@nx/helpdeskURDTKT · MSG · CAT · SLA · AGT · NTF

TL;DR

Gives a merchant's support team a first-class way to receive, route, and resolve customer requests within committed service levels. Customers raise tickets, the system auto-assigns them to the best available agent, SLA policies keep response and resolution times honest with warning/breach escalation, and every event fans out as real-time and email notifications. The result: support is tracked end-to-end instead of scattered across ad-hoc channels.

1. Context & Problem

KICKO merchants have no first-class way to receive, route, and resolve customer support requests within committed service levels. Support arrives across scattered, untracked channels: there is no ticket document with a controlled lifecycle, no way to tie a request to a responsible agent, and no service-level clock to keep response and resolution times honest. This makes support load, agent accountability, and SLA compliance impossible to measure - a gap for the merchants KICKO serves as they scale customer operations.

This increment stands up the Helpdesk backend as a new IGNIS package and delivers the support core: ticket lifecycle, threaded messages, classification, SLA enforcement, agent routing, and event notifications.

2. Goals & Non-Goals

Goals

  • A support ticket lifecycle: create, classify, assign, transition through the 8-status state machine, resolve, and close - with a full audit trail and soft-delete.
  • Threaded ticket messages: customer/agent replies, internal notes (agent-only), system messages, and attachments.
  • Ticket classification: hierarchical categories carrying routing defaults, tags, and four priority levels.
  • SLA management: policies with per-priority response/resolution targets, per-ticket trackers, warning/breach thresholds, a scheduled monitor, and three-level escalation.
  • Agent management: agent profiles (availability, skills, languages, workload cap), agent groups, prioritized assignment rules, and an auto-assignment worker with multiple strategies.
  • Event notifications: real-time (WebSocket) and email alerts on ticket events, with worker-driven delivery and templates.

Non-Goals

  • AI-assisted reply suggestions and predictive SLA-breach warning.
  • Omni-channel intake (email, Zalo OA, Facebook Messenger).
  • Customer-facing self-service ticket portal.
  • SLA reporting dashboards - owned by the Reports module.
  • Knowledge base (KB), surveys (SRV), and feature requests (FR) - those P2 areas are out of this core increment.

3. Success Metrics

MetricTarget / signal
Traceability100% of support requests flow through a tracked ticket, not ad-hoc channels
First-response timeFirst-response deadline met within the SLA target per priority
Auto-assignment coverageNew tickets auto-routed to an eligible agent within 2 minutes
SLA complianceShare of tickets resolved before breach trends up; warning fires before breach
Escalation healthBreached/critical tickets escalate across L1→L3 without manual chasing

4. Personas & Use Cases

PersonaGoal in this feature
CustomerRaise a request, get replies, confirm resolution
Support AgentWork assigned tickets, reply, add internal notes, resolve within SLA
Support ManagerConfigure SLA policies, assignment rules, categories; handle escalations

Core scenarios: a customer raises a ticket → the system opens it, starts the SLA clock, and auto-assigns the best available agent → the agent replies and works the lifecycle → SLA is tracked with warning/breach escalation → the ticket is resolved and closed, with notifications at every step.

5. User Stories

  • As a customer, I want to raise a support ticket with a subject, category, and priority, so my request is tracked.
  • As a support agent, I want new tickets auto-assigned to me based on skills and load, so I work the right tickets without manual triage.
  • As a support agent, I want to reply, add internal notes, and attach files, so I can collaborate and resolve the ticket.
  • As a support agent, I want the ticket to move through a clear status lifecycle, so its state is always unambiguous.
  • As a support manager, I want SLA policies with response/resolution targets per priority, so the team is held to committed service levels.
  • As a support manager, I want breached or critical tickets to escalate across levels, so nothing falls through the cracks.
  • As a customer, I want real-time and email alerts on my ticket, so I know when an agent responds.

6. Functional Requirements

#RequirementURD ref
FR-1Create a merchant-scoped ticket with subject, description, category, and priority; reporter is customer-raised or agent-raised on behalf of a customerURD-TKT-001..003
FR-2Ticket follows the 8-status lifecycle OPEN → ASSIGNED → IN_PROGRESS → WAITING_USER / WAITING_INTERNAL → ESCALATED → RESOLVED → CLOSED, with assignment/resolution/closure details, a full audit trail, and soft-delete onlyURD-TKT-004..008,012
FR-3Re-open on customer reply after resolution; customer confirms resolution and a resolved ticket auto-closes 48h after with no responseURD-TKT-009..010
FR-4Threaded typed messages (comment, customer/agent reply, internal note, system, auto-reply) with attachments and tracked author; internal notes never returned to non-agents; a system message is auto-appended on each transitionURD-MSG-001..005
FR-5Hierarchical ticket categories carrying default priority, skills, group, and SLA policy; ticket tags; four priority levels (Low/Medium/High/Critical)URD-CAT-001..005
FR-6SLA policies with per-priority response/resolution targets, configurable warning (75%) and critical (90%) thresholds, optional business-hours-only clockURD-SLA-001..003
FR-7Per-ticket SLA tracker created at ticket creation; a scheduled monitor marks warning/breached automatically and records first-response and time-to-resolutionURD-SLA-004..006
FR-8Three escalation levels (L1/L2/L3) with typed triggers (SLA breach, manual, customer request, high impact, incident); rules configurable in a policy; a category SLA overrides the global defaultURD-SLA-007..010
FR-9Agent profiles (one per user) with availability, skills, languages, and a max concurrent cap; agent groups with membership managementURD-AGT-001..004
FR-10Prioritized per-merchant assignment rules with multiple strategies; an auto-assignment worker selects the best available agent and skips agents at their capURD-AGT-005..007,010
FR-11Track agent performance (avg response/resolution, SLA compliance, satisfaction) and a business-hours availability scheduleURD-AGT-008..009
FR-12Real-time (WebSocket) and email notifications on ticket events, per-user preferences, customizable templates, and batched delivery with a per-recipient logURD-NTF-001..005

Full requirement text and acceptance criteria live in the Helpdesk URD. This PRD references them rather than restating them.

7. Non-Functional Requirements

AreaRequirement
Data integrityOne SLA tracker per ticket, immutable after breach; every state change and action recorded in the audit trail
ImmutabilityInternal notes are never returned to non-agent consumers; system messages are auto-appended, not edited in place
Tenancy & authzTickets are always scoped to a single merchant (organizer-scoped); agent vs. manager actions gated by helpdesk permissions
Performance / scaleAuto-assignment runs within 2 minutes of ticket creation; the SLA monitor runs on a schedule independent of request traffic
Soft-deleteAll records soft-deleted only
i18nUser-facing labels, statuses, resolution notes, and email templates are bilingual ({ en, vi })

8. UX & Flows

Key screens are served by the Helpdesk backend's APIs and surfaced in the merchant support workspace; ticket, message, SLA-tracker, and agent-assignment views all read from @nx/helpdesk.

9. Data & Domain

EntityRole
TicketThe support request document - merchant scope, status, priority, category, assigned agent, audit trail
TicketMessageA typed thread entry (customer/agent reply, internal note, system, auto-reply) with attachments and tracked author
TicketCategoryHierarchical classification carrying default priority, skills, group, and SLA policy
SlaPolicyPer-priority response/resolution targets, thresholds, and escalation rules
SlaTrackerPer-ticket deadlines and elapsed time against an SLA policy
SlaEscalationA typed escalation (L1/L2/L3) raised on breach or by request
AgentA user linked as a support agent - availability, skills, languages, workload cap
AgentGroupA grouping of agents with managed membership
Assignment rulePrioritized per-merchant rule selecting the auto-assignment strategy
Notification + workerReal-time/email delivery records and the scheduled notification/SLA-monitor workers

Conceptual only - full schema and invariants in the helpdesk domain model.

10. Dependencies & Assumptions

Depends on

  • User Management (CORE-01) - customer and agent accounts; an agent is a user linked to a merchant.
  • Commerce (CORE-03) - merchant scope and order/product context used to enrich a ticket.
  • Signal (real-time) - delivers live ticket updates to agents and customers over WebSocket.
  • Reports (CORE-11) - downstream consumer of SLA-compliance and satisfaction data.

Assumptions

  • The merchant has at least one agent and a configured SLA policy (or a default applies).
  • Assignment rules are configured for auto-assignment to run; otherwise tickets stay unassigned for manual pickup.

11. Risks & Open Questions

Risk / questionMitigation / status
Backend does not currently compile cleanlyBuild repair is the gate before any requirement is treated as verified-shipped; tracked as the module's known issue
No available agent at assignment timeAuto-assignment escalates to a manager when no eligible agent is found
SLA monitor lag could miss a tight deadlineMonitor runs on a schedule; thresholds (75%/90%) give warning headroom before breach
Internal-note leakage to customersEnforced server-side - internal notes are never returned to non-agent consumers
Organizer vs. merchant scoping for agents/SLAResolved: SLA/agent/ticket logic is organizer-scoped (organizerId, nullable)

12. Release Plan & Launch Criteria

AspectPlan
PhaseP1 support core - see URD feature catalog
RolloutAll merchants; no feature flag
MigrationNone (new package and entities; config seeded at startup)
Launch criteriaPackage builds cleanly; create→assign→reply→resolve→close verified end-to-end; SLA warning/breach/escalation fires on schedule; notifications delivered
MonitoringTicket volume per merchant, auto-assignment success rate, SLA warning/breach counts, notification delivery log

13. FAQ

What are the ticket statuses? Eight: OPEN → ASSIGNED → IN_PROGRESS → WAITING_USER / WAITING_INTERNAL → ESCALATED → RESOLVED → CLOSED.

How does a ticket get assigned? An auto-assignment worker evaluates prioritized rules and picks the best available agent by strategy (round robin, skill-based, load-balanced, and more), skipping any agent at their concurrent cap; a manager can also assign manually.

What happens when an SLA is about to breach? A scheduled monitor marks the tracker as warning at 75% of the deadline and breached at 100%, creating an L1 escalation; escalation can climb to L2 and L3.

Can customers see internal notes? No - internal notes are agent-only and are never returned to non-agent consumers.

Does this increment include the knowledge base or surveys? No - KB, SRV, and FR are P2 and out of this core scope; only their worker scaffolding (e.g. the survey-trigger worker) exists here.

Are tickets ever hard-deleted? No - all helpdesk records are soft-deleted only.

References

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.