- 3.1 currency: replace hardcoded $ with AED <Money/> in item & job-card price cells - 5.1 calendar: /calendars now renders the month calendar (was redirect to list) - 7.2 nav: remove dead Time Clocks / Time Sheets links (no routes, 404) - 5.4 check-in: enforce required department at schema level - 5.6 payments received: add invoice picker so the invoice is marked Paid - 5.2 share link: forward ws workspace param from the public inspection page Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
39 lines
1.5 KiB
TypeScript
39 lines
1.5 KiB
TypeScript
import { ColumnHeader } from "@/shared/data-view/table-view"
|
|
import { Money } from "@/shared/components/money"
|
|
import type { ColumnDef } from "@tanstack/react-table"
|
|
|
|
/** Core service columns shared between the services page and selector dialogs. */
|
|
export const serviceColumns = {
|
|
name: {
|
|
accessorKey: "labor_name",
|
|
header: ({ column }) => <ColumnHeader column={column} title="Name" />,
|
|
cell: ({ row }) => {
|
|
const r = row.original as any
|
|
return (
|
|
<div>
|
|
<span className="font-medium">{r.labor_name || r.name || "—"}</span>
|
|
{r.service_code && (
|
|
<span className="ml-2 text-xs text-muted-foreground">{r.service_code}</span>
|
|
)}
|
|
</div>
|
|
)
|
|
},
|
|
},
|
|
description: {
|
|
accessorKey: "description",
|
|
header: ({ column }) => <ColumnHeader column={column} title="Description" />,
|
|
cell: ({ row }) => {
|
|
const val = (row.original as any).description
|
|
return val ? <span className="max-w-48 truncate block">{val}</span> : "—"
|
|
},
|
|
},
|
|
sellingPrice: {
|
|
accessorKey: "selling_price",
|
|
header: ({ column }) => <ColumnHeader column={column} title="Price" />,
|
|
cell: ({ row }) => {
|
|
const val = (row.original as any).selling_price
|
|
return val != null ? <Money value={val} /> : "—"
|
|
},
|
|
},
|
|
} satisfies Record<string, ColumnDef<any, any>>
|