Change ticket IDs from UUID to sequential integers
Backend: - tickets.id: uuid → integer GENERATED ALWAYS AS IDENTITY - transactions.ticket_id, custom_field_values.ticket_id: uuid → integer - Routes convert string params to Number() for DB queries - ScripEngine.prepare takes ticketId: number - ActionPayload.ticketId: string → number Frontend: - Ticket.id: string → number, Transaction.ticket_id: string → number - API functions accept number params - formatTicketId() helper returns TKT-0001 format - Ticket rows display TKT-XXXX, detail page uses formatTicketId Migration: drops FKs, clears data, alters column types, re-adds FKs
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
} from "@/components/ui/dialog";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { cn, formatTicketId } from "@/lib/utils";
|
||||
|
||||
const STATUS_COLORS: Record<string, string> = {
|
||||
new: "#8a8f98",
|
||||
@@ -38,7 +38,7 @@ type FilterKey = (typeof FILTERS)[number]["key"];
|
||||
|
||||
function TicketRow({ ticket, onClick }: { ticket: Ticket; onClick: () => void }) {
|
||||
const statusColor = STATUS_COLORS[ticket.status] || STATUS_COLORS.new;
|
||||
const shortId = ticket.id.slice(0, 8);
|
||||
const shortId = formatTicketId(ticket.id);
|
||||
const timeAgo = formatDistanceToNow(new Date(ticket.updated_at), { addSuffix: true });
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user