diff --git a/apps/hq-web/src/pages/Tickets.tsx b/apps/hq-web/src/pages/Tickets.tsx index d33331b..dc6b3e2 100644 --- a/apps/hq-web/src/pages/Tickets.tsx +++ b/apps/hq-web/src/pages/Tickets.tsx @@ -5,7 +5,7 @@ import { FormField, FormGrid, Notice, PageHeader, Skeleton, Toolbar, useToast, } from '@sims/ui' import { - createTicket, getBranches, getClients, getEmployees, getTickets, patchTicket, staffId, + createTicket, getBranches, getClients, getEmployees, getModules, getTickets, patchTicket, staffId, TICKET_STATUSES, type Branch, type Client, type Employee, type Ticket, type TicketStatus, } from '../api' @@ -13,7 +13,8 @@ import { useData } from './Clients' const PAGE_SIZE = 50 -/** The five APEX service lines (D20 design ยง1) โ€” suggestions only; module stays free text. */ +/** Fallback suggestions while the catalog loads โ€” the live module list is the + * real source, so a module added tomorrow shows up here with zero code changes. */ export const TICKET_MODULE_CODES = ['SMS', 'RTGS', 'WHATSAPP', 'MOBILEAPP', 'ATM'] export const TICKET_STATUS_LABEL: Record = { @@ -120,6 +121,8 @@ export function NewTicketDialog(props: { const [f, setF] = useState({ branchId: '', moduleCode: '', kind: '', description: '', onlineOffline: '' }) const [error, setError] = useState() const [saving, setSaving] = useState(false) + // Live catalog feeds the suggestions โ€” future modules appear with zero code changes. + const catalog = useData(getModules, []) useEffect(() => { if (!props.open) return @@ -230,7 +233,10 @@ export function NewTicketDialog(props: { - {TICKET_MODULE_CODES.map((m) => {props.kinds.map((k) =>