Skip to content

12.5 Ticket Domain and API

Sprint: Sprint 12 - Notifications and Ticketing
Feature ID: 12.5
Subtasks: 12.5.1, 12.5.2, 12.5.3, 12.5.4

Objective

Deliver "Ticket Domain and API" within Sprint 12 - Notifications and Ticketing.

Dependencies

Aggregated from the subtasks below (prerequisite task IDs and enablers):

  • 12.4.2
  • 12.5.1

Subtasks

12.5.1 Open ticket with SLA assignment

  • ID: 12.5.1
  • Title: Implement POST /api/v1/tickets with SLA-based auto-assignment
  • Description: OpenTicketCommand creating a ticket, computing sla_due_at and assigned_team from the SLA policy for its category/priority (FR-32), and publishing ticket.opened.v1 and ticket.assigned.v1.
  • Business Purpose: Capture and route customer requests (FR-31, FR-32).
  • Inputs: FR-31, FR-32, event-catalog ticket events.
  • Outputs: Open command, endpoint, SLA assignment, events.
  • Acceptance Criteria:
  • Opening a ticket sets sla_due_at and a team per policy, emits ticket.opened.v1 and ticket.assigned.v1; ticket.opened.v1 ultimately notifies the customer (FR-33 via 12.3.1).
  • Dependencies: 12.4.2
  • Complexity: M

12.5.2 Comment, assign, resolve

  • ID: 12.5.2
  • Title: Implement comment/assign/resolve endpoints
  • Description: POST /{id}/comments, POST /{id}/assign, POST /{id}/resolve commands; resolve sets resolved_at and emits ticket.resolved.v1; manual assign emits ticket.assigned.v1.
  • Business Purpose: Ticket workflow management (FR-31).
  • Inputs: FR-31, analysis Section 8.9.
  • Outputs: Commands + endpoints + events.
  • Acceptance Criteria:
  • Comments append; assign updates the team and emits the event; resolve transitions to RESOLVED and emits ticket.resolved.v1.
  • Dependencies: 12.5.1
  • Complexity: M

12.5.3 SLA breach detection

  • ID: 12.5.3
  • Title: Detect SLA breaches and emit ticket.sla-breached.v1
  • Description: A scheduled check emitting ticket.sla-breached.v1 for unresolved tickets past sla_due_at (consumed by notification).
  • Business Purpose: Surface SLA violations for escalation (FR-32).
  • Inputs: FR-32, event-catalog ticket.sla-breached.v1.
  • Outputs: SLA-breach scheduler + event.
  • Acceptance Criteria:
  • An unresolved ticket past its SLA emits ticket.sla-breached.v1 once.
  • Dependencies: 12.5.1
  • Complexity: S

12.5.4 Ticket read endpoint

  • ID: 12.5.4
  • Title: Implement GET /api/v1/tickets/{id}
  • Description: GetTicketQuery returning the ticket with comments and SLA status as ApiResult.
  • Business Purpose: Ticket visibility (FR-31).
  • Inputs: FR-31.
  • Outputs: Query + endpoint.
  • Acceptance Criteria:
  • GET returns the ticket and its comments; unknown id returns 404.
  • Dependencies: 12.5.1
  • Complexity: S

Acceptance Criteria

Each subtask above carries its own objective, testable acceptance criteria. This feature is complete when every subtask's acceptance criteria are met.

Deliverables

  • Open command, endpoint, SLA assignment, events.
  • Commands + endpoints + events.
  • SLA-breach scheduler + event.
  • Query + endpoint.

Definition of Done

  • All subtasks (12.5.1, 12.5.2, 12.5.3, 12.5.4) completed and their acceptance criteria verified.
  • All listed dependencies satisfied.
  • Build and tests green per the global conventions in ../README.md (Section 3).