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
- View Tickets: Admins see all tickets created by therapists/parents from mobile app
- External Resolution: Admin team communicates directly with users outside the platform
- Status Update: Admin marks tickets as RESOLVED or CLOSED after external handling
- 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
| Action | Operation |
|---|---|
| List Tickets | supportTickets(filter) |
| View Details | supportTicket(id) |
| Resolve | resolveSupportTicket(input) |
| Close | closeSupportTicket(input) |