Files
petvity/lib/config/orders.ts
T
GandClaude Opus 5 c65ac4b7d7 chore: add a formatter (#71)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* style: format with prettier (252 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: teach git blame to skip the reformat

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 10:05:01 +00:00

88 lines
2.5 KiB
TypeScript

/**
* SSOT for order and booking status display config.
* Enum values must match orderStatusEnum / bookingStatusEnum in lib/db/schema.ts.
* Icons are intentionally excluded — they are React components and belong in the UI layer.
*/
/**
* `badge` is the semantic tone class from globals.css — the portal's one badge
* vocabulary. `color`/`bg`/`className` are the older arbitrary-value strings,
* kept only where a status tints something that is not a badge.
*/
export const ORDER_STATUS_CONFIG = {
pending: {
label: "Pending",
badge: "badge-warn",
color: "text-[var(--warn)]",
bg: "bg-[var(--warn-bg)]",
className: "bg-[var(--warn-bg)] text-[var(--warn)]",
},
confirmed: {
label: "Confirmed",
badge: "badge-green",
color: "text-[var(--green)]",
bg: "bg-[var(--green-bg)]",
className: "bg-[var(--green-bg)] text-[var(--green)]",
},
shipped: {
label: "Shipped",
badge: "badge-teal",
color: "text-[var(--teal)]",
bg: "bg-[var(--teal-light)]",
className: "bg-[var(--teal-light)] text-[var(--teal)]",
},
delivered: {
label: "Delivered",
badge: "badge-teal",
color: "text-[var(--teal)]",
bg: "bg-[var(--teal-light)]",
className: "bg-[var(--teal-light)] text-[var(--teal)]",
},
cancelled: {
label: "Cancelled",
badge: "badge-neutral",
color: "text-[var(--muted)]",
bg: "bg-[var(--off)]",
className: "bg-[var(--off)] text-[var(--muted)]",
},
} as const;
export type OrderStatusId = keyof typeof ORDER_STATUS_CONFIG;
export function orderStatusLabel(status: string): string {
return ORDER_STATUS_CONFIG[status as OrderStatusId]?.label ?? status;
}
export const BOOKING_STATUS_CONFIG = {
pending: {
label: "Pending",
badge: "badge-warn",
color: "text-[var(--warn)]",
bg: "bg-[var(--warn-bg)]",
className: "bg-[var(--warn-bg)] text-[var(--warn)]",
},
confirmed: {
label: "Confirmed",
badge: "badge-green",
color: "text-[var(--green)]",
bg: "bg-[var(--green-bg)]",
className: "bg-[var(--green-bg)] text-[var(--green)]",
},
cancelled: {
label: "Cancelled",
badge: "badge-neutral",
color: "text-[var(--muted)]",
bg: "bg-[var(--off)]",
className: "bg-[var(--off)] text-[var(--muted)]",
},
completed: {
label: "Completed",
badge: "badge-teal",
color: "text-[var(--teal)]",
bg: "bg-[var(--teal-light)]",
className: "bg-[var(--teal-light)] text-[var(--teal)]",
},
} as const;
export type BookingStatusId = keyof typeof BOOKING_STATUS_CONFIG;