/** * Terms & Conditions catalogue (issue #11) — admin-managed clauses that populate * the PO's named T&C dropdowns. Each clause has a category matching one of the * PO's tc* slots; the chosen clause is stored as a text snapshot in that column. */ import type { TermsCategory } from "@prisma/client"; // The five catalogued slots (the PO's "Others" stays free text; the fixed // boilerplate lines are not catalogued). Order = display order. export const TERMS_CATEGORIES: TermsCategory[] = [ "DELIVERY", "DISPATCH", "INSPECTION", "TRANSIT_INSURANCE", "PAYMENT_TERMS", ]; export const TERMS_CATEGORY_LABEL: Record = { DELIVERY: "Delivery", DISPATCH: "Dispatch Instructions", INSPECTION: "Inspection", TRANSIT_INSURANCE: "Transit Insurance", PAYMENT_TERMS: "Payment Terms", }; // PO tc* form field ⇄ catalogue category. export const TC_FIELD_CATEGORY: Record = { tcDelivery: "DELIVERY", tcDispatch: "DISPATCH", tcInspection: "INSPECTION", tcTransitInsurance: "TRANSIT_INSURANCE", tcPaymentTerms: "PAYMENT_TERMS", }; // Server → client shape: active clause texts grouped by category. export type TermsByCategory = Partial>;