Skip to main content

Support Tickets

Support provides admin visibility into tickets created by therapists and parents from the mobile app. Admins can view ticket details and resolve/close tickets after handling them externally through direct communication.

Roles & Permissions

  • Admin: view all tickets, resolve/close tickets
  • No multi-admin or admin-user roles
  • No chat/comments/assign/progress features

Ticket Model

  • id, subject, category, priority, status (OPEN | RESOLVED | CLOSED), created_by (therapist/parent), created_at, updated_at, resolved_at
  • No comments, assignments, or progress tracking

UI Flows

List & Filter

const filtered = tickets
.filter((t) => !status || t.status === status)
.filter((t) => !category || t.category === category)
.filter((t) => !priority || t.priority === priority)
.filter(
(t) => !query || t.subject.toLowerCase().includes(query.toLowerCase()),
);

Ticket Management

  1. View Tickets: Admins see all tickets created by therapists/parents from mobile app
  2. External Resolution: Admin team communicates directly with users outside the platform
  3. Status Update: Admin marks tickets as RESOLVED or CLOSED after external handling
  4. No Internal Communication: No chat, comments, or assignment features within the platform

Data Model

  • Support Ticket: id, subject, category, priority, status (OPEN | RESOLVED | CLOSED), created_by (therapist/parent user_id), created_at, updated_at, resolved_at
  • No Comments: No internal communication or comment system
  • No Assignments: No multi-admin or assignment features
  • No Progress Tracking: Simple status-based workflow

GraphQL Contracts

import { gql } from '@apollo/client';

// View Tickets (Admin only)
export const LIST_TICKETS = gql`
query SupportTickets($filter: SupportTicketFilter!) {
supportTickets(filter: $filter) {
id
subject
category
priority
status
created_by
created_at
updated_at
resolved_at
}
}
`;

export const GET_TICKET_DETAILS = gql`
query TicketDetails($id: ID!) {
supportTicket(id: $id) {
id
subject
category
priority
status
description
created_by {
id
name
role
}
created_at
updated_at
resolved_at
}
}
`;

// Update Status (Admin only)
export const RESOLVE_TICKET = gql`
mutation ResolveTicket($input: ResolveSupportTicketInput!) {
resolveSupportTicket(input: $input) {
success
message
data {
id
status
resolved_at
}
}
}
`;

export const CLOSE_TICKET = gql`
mutation CloseTicket($input: CloseSupportTicketInput!) {
closeSupportTicket(input: $input) {
success
message
data {
id
status
resolved_at
}
}
}
`;

Validation & Rules

  • Subject: required, 3–140 chars
  • Category: required, predefined list
  • Priority: one of LOW/MEDIUM/HIGH
  • Status transitions: OPEN → RESOLVED → CLOSED (no reverse)
  • Only admins can resolve/close tickets
  • Tickets created by therapists/parents from mobile app only

Troubleshooting

  • "Cannot view tickets": verify admin role and permissions
  • "Cannot resolve ticket": ensure you have admin access
  • "Ticket not found": verify ticket exists and is not deleted
  • "Status update failed": check if ticket is already closed

Mapping Table

ActionOperation
List TicketssupportTickets(filter)
View DetailssupportTicket(id)
ResolveresolveSupportTicket(input)
ClosecloseSupportTicket(input)