/** * Format a client-ticket number for display, e.g. `CT-001`. */ export function formatTicketNumber(value: number): string { return `CT-${String(value).padStart(3, '0')}` } /** * Extract the numeric id from an API Platform IRI (e.g. `/api/projects/5` → 5). * Returns null when the IRI cannot be parsed. */ export function iriToId(iri: string | null | undefined): number | null { if (!iri) { return null } const match = iri.match(/(\d+)$/) return match ? Number(match[1]) : null }