diff --git a/App/pelagia-portal/app/(portal)/approvals/[id]/manager-edit-po-form.tsx b/App/pelagia-portal/app/(portal)/approvals/[id]/manager-edit-po-form.tsx index 75a7c30..b78d630 100644 --- a/App/pelagia-portal/app/(portal)/approvals/[id]/manager-edit-po-form.tsx +++ b/App/pelagia-portal/app/(portal)/approvals/[id]/manager-edit-po-form.tsx @@ -11,7 +11,8 @@ import type { Vessel, Account, Vendor, PurchaseOrder } from "@prisma/client"; type SerializedLineItem = { id: string; poId: string; - description: string; + name: string; + description: string | null; quantity: number; unit: string; size: string | null; @@ -59,7 +60,8 @@ export function ManagerEditPoForm({ po, vessels, accounts, vendors }: Props) { const [lineItems, setLineItems] = useState( po.lineItems.map((li) => ({ - description: li.description, + name: li.name, + description: li.description ?? undefined, quantity: li.quantity, unit: li.unit, size: li.size ?? undefined, @@ -79,7 +81,8 @@ export function ManagerEditPoForm({ po, vessels, accounts, vendors }: Props) { const form = document.getElementById("mgr-edit-po-form") as HTMLFormElement; const data = new FormData(form); lineItems.forEach((item, i) => { - data.set(`lineItems[${i}].description`, item.description); + data.set(`lineItems[${i}].name`, item.name); + data.set(`lineItems[${i}].description`, item.description ?? ""); data.set(`lineItems[${i}].quantity`, String(item.quantity)); data.set(`lineItems[${i}].unit`, item.unit); data.set(`lineItems[${i}].size`, item.size ?? ""); diff --git a/App/pelagia-portal/app/(portal)/approvals/[id]/manager-line-edit-actions.ts b/App/pelagia-portal/app/(portal)/approvals/[id]/manager-line-edit-actions.ts index c228c10..cb37e18 100644 --- a/App/pelagia-portal/app/(portal)/approvals/[id]/manager-line-edit-actions.ts +++ b/App/pelagia-portal/app/(portal)/approvals/[id]/manager-line-edit-actions.ts @@ -9,7 +9,8 @@ import { z } from "zod"; type ActionResult = { ok: true } | { error: string }; const lineItemSchema = z.object({ - description: z.string().min(1), + name: z.string().min(1), + description: z.string().optional(), quantity: z.coerce.number().positive(), unit: z.string().min(1), size: z.string().optional(), @@ -22,7 +23,7 @@ export async function managerEditLineItems({ lineItems, }: { poId: string; - lineItems: Array<{ description: string; quantity: number; unit: string; size?: string; unitPrice: number }>; + lineItems: Array<{ name: string; description?: string; quantity: number; unit: string; size?: string; unitPrice: number }>; }): Promise { const session = await auth(); if (!session?.user || !hasPermission(session.user.role, "approve_po")) { @@ -40,7 +41,8 @@ export async function managerEditLineItems({ if (po.status !== "MGR_REVIEW") return { error: "Line items can only be edited while the PO is under review." }; const originalSnapshot = po.lineItems.map((li) => ({ - description: li.description, + name: (li as typeof li & { name: string }).name, + description: li.description ?? undefined, quantity: Number(li.quantity), unit: li.unit, size: li.size ?? undefined, @@ -59,7 +61,8 @@ export async function managerEditLineItems({ lineItems: { deleteMany: {}, create: parsed.data.map((item, idx) => ({ - description: item.description, + name: item.name, + description: item.description ?? null, quantity: item.quantity, unit: item.unit, size: item.size ?? null, diff --git a/App/pelagia-portal/app/(portal)/approvals/[id]/manager-po-edit-actions.ts b/App/pelagia-portal/app/(portal)/approvals/[id]/manager-po-edit-actions.ts index 66eca84..a651439 100644 --- a/App/pelagia-portal/app/(portal)/approvals/[id]/manager-po-edit-actions.ts +++ b/App/pelagia-portal/app/(portal)/approvals/[id]/manager-po-edit-actions.ts @@ -24,13 +24,14 @@ export async function managerEditPo( // Parse line items from FormData const lineItems: Array<{ - description: string; quantity: number; unit: string; + name: string; description?: string; quantity: number; unit: string; size?: string; unitPrice: number; gstRate: number; }> = []; let i = 0; - while (formData.has(`lineItems[${i}].description`)) { + while (formData.has(`lineItems[${i}].name`)) { lineItems.push({ - description: formData.get(`lineItems[${i}].description`) as string, + name: formData.get(`lineItems[${i}].name`) as string, + description: (formData.get(`lineItems[${i}].description`) as string) || undefined, quantity: Number(formData.get(`lineItems[${i}].quantity`)), unit: formData.get(`lineItems[${i}].unit`) as string, size: (formData.get(`lineItems[${i}].size`) as string) || undefined, @@ -97,12 +98,13 @@ export async function managerEditPo( tcOthers: extPo.tcOthers, totalAmount: Number(po.totalAmount), lineItems: po.lineItems.map((li) => ({ - description: li.description, + name: (li as typeof li & { name: string }).name, + description: li.description ?? undefined, quantity: Number(li.quantity), unit: li.unit, size: li.size ?? undefined, unitPrice: Number(li.unitPrice), - gstRate: Number((li as typeof li & { gstRate?: unknown }).gstRate ?? 0.18), + gstRate: Number(li.gstRate ?? 0.18), })), }; @@ -130,7 +132,8 @@ export async function managerEditPo( lineItems: { deleteMany: {}, create: data.lineItems.map((item, idx) => ({ - description: item.description, + name: item.name, + description: item.description ?? null, quantity: item.quantity, unit: item.unit, size: item.size ?? null, diff --git a/App/pelagia-portal/app/(portal)/approvals/[id]/page.tsx b/App/pelagia-portal/app/(portal)/approvals/[id]/page.tsx index 6b598bd..7367833 100644 --- a/App/pelagia-portal/app/(portal)/approvals/[id]/page.tsx +++ b/App/pelagia-portal/app/(portal)/approvals/[id]/page.tsx @@ -56,7 +56,7 @@ export default async function ApprovalDetailPage({ params }: Props) { }; return ( -
+

Review Purchase Order

diff --git a/App/pelagia-portal/app/(portal)/po/[id]/edit/actions.ts b/App/pelagia-portal/app/(portal)/po/[id]/edit/actions.ts index f8ef0a8..4997fa1 100644 --- a/App/pelagia-portal/app/(portal)/po/[id]/edit/actions.ts +++ b/App/pelagia-portal/app/(portal)/po/[id]/edit/actions.ts @@ -9,9 +9,10 @@ import { revalidatePath } from "next/cache"; function parseLineItems(formData: FormData) { const items = []; let i = 0; - while (formData.has(`lineItems[${i}].description`)) { + while (formData.has(`lineItems[${i}].name`)) { items.push({ - description: formData.get(`lineItems[${i}].description`) as string, + name: formData.get(`lineItems[${i}].name`) as string, + description: (formData.get(`lineItems[${i}].description`) as string) || undefined, quantity: Number(formData.get(`lineItems[${i}].quantity`)), unit: formData.get(`lineItems[${i}].unit`) as string, size: (formData.get(`lineItems[${i}].size`) as string) || undefined, @@ -100,7 +101,8 @@ export async function updatePo( lineItems: { deleteMany: {}, create: data.lineItems.map((item, idx) => ({ - description: item.description, + name: item.name, + description: item.description ?? null, quantity: item.quantity, unit: item.unit, size: item.size ?? null, diff --git a/App/pelagia-portal/app/(portal)/po/[id]/edit/edit-po-form.tsx b/App/pelagia-portal/app/(portal)/po/[id]/edit/edit-po-form.tsx index 100c707..16d61d3 100644 --- a/App/pelagia-portal/app/(portal)/po/[id]/edit/edit-po-form.tsx +++ b/App/pelagia-portal/app/(portal)/po/[id]/edit/edit-po-form.tsx @@ -14,7 +14,8 @@ const INPUT_CLS = type SerializedLineItem = { id: string; poId: string; - description: string; + name: string; + description: string | null; quantity: number; unit: string; size: string | null; @@ -41,7 +42,8 @@ export function EditPoForm({ po, vessels, accounts, vendors }: Props) { const router = useRouter(); const [lineItems, setLineItems] = useState( po.lineItems.map((li) => ({ - description: li.description, + name: li.name, + description: li.description ?? undefined, quantity: li.quantity, unit: li.unit, size: li.size ?? undefined, @@ -61,7 +63,8 @@ export function EditPoForm({ po, vessels, accounts, vendors }: Props) { const data = new FormData(form); data.set("intent", intent); lineItems.forEach((item, i) => { - data.set(`lineItems[${i}].description`, item.description); + data.set(`lineItems[${i}].name`, item.name); + data.set(`lineItems[${i}].description`, item.description ?? ""); data.set(`lineItems[${i}].quantity`, String(item.quantity)); data.set(`lineItems[${i}].unit`, item.unit); data.set(`lineItems[${i}].size`, item.size ?? ""); diff --git a/App/pelagia-portal/app/(portal)/po/[id]/edit/page.tsx b/App/pelagia-portal/app/(portal)/po/[id]/edit/page.tsx index f9d7bb9..ae99d5a 100644 --- a/App/pelagia-portal/app/(portal)/po/[id]/edit/page.tsx +++ b/App/pelagia-portal/app/(portal)/po/[id]/edit/page.tsx @@ -48,7 +48,7 @@ export default async function EditPoPage({ params }: Props) { }; return ( -
+

Edit Purchase Order

{po.poNumber}

diff --git a/App/pelagia-portal/app/(portal)/po/[id]/page.tsx b/App/pelagia-portal/app/(portal)/po/[id]/page.tsx index 3ea595f..4884165 100644 --- a/App/pelagia-portal/app/(portal)/po/[id]/page.tsx +++ b/App/pelagia-portal/app/(portal)/po/[id]/page.tsx @@ -55,7 +55,7 @@ export default async function PoDetailPage({ params }: Props) { : []; return ( -
+
{canProvideVendorId && }
diff --git a/App/pelagia-portal/app/(portal)/po/import/actions.ts b/App/pelagia-portal/app/(portal)/po/import/actions.ts index 3165b1f..17200e1 100644 --- a/App/pelagia-portal/app/(portal)/po/import/actions.ts +++ b/App/pelagia-portal/app/(portal)/po/import/actions.ts @@ -58,7 +58,7 @@ export async function importPo( submitterId: session.user.id, lineItems: { create: input.lineItems.map((item, idx) => ({ - description: item.description, + name: item.name, quantity: item.quantity, unit: item.unit, unitPrice: item.unitPrice, diff --git a/App/pelagia-portal/app/(portal)/po/import/import-form.tsx b/App/pelagia-portal/app/(portal)/po/import/import-form.tsx index a6ea0e7..9e2e02e 100644 --- a/App/pelagia-portal/app/(portal)/po/import/import-form.tsx +++ b/App/pelagia-portal/app/(portal)/po/import/import-form.tsx @@ -251,7 +251,7 @@ export function ImportForm({ vessels, accounts, vendors }: Props) { const lineTotal = taxable * (1 + (li.gstRate ?? 0.18)); return ( - {li.description} + {li.name} {li.quantity} {li.unit} {formatCurrency(li.unitPrice)} diff --git a/App/pelagia-portal/app/(portal)/po/import/page.tsx b/App/pelagia-portal/app/(portal)/po/import/page.tsx index 53d0597..80c712d 100644 --- a/App/pelagia-portal/app/(portal)/po/import/page.tsx +++ b/App/pelagia-portal/app/(portal)/po/import/page.tsx @@ -20,7 +20,7 @@ export default async function ImportPoPage() { ]); return ( -
+

Import Purchase Order

diff --git a/App/pelagia-portal/app/(portal)/po/new/actions.ts b/App/pelagia-portal/app/(portal)/po/new/actions.ts index d176270..e7ad4dd 100644 --- a/App/pelagia-portal/app/(portal)/po/new/actions.ts +++ b/App/pelagia-portal/app/(portal)/po/new/actions.ts @@ -23,7 +23,8 @@ export async function createPo( const intent = formData.get("intent") as "draft" | "submit"; const lineItems: Array<{ - description: string; + name: string; + description?: string; quantity: number; unit: string; size?: string; @@ -32,9 +33,10 @@ export async function createPo( productId?: string; }> = []; let i = 0; - while (formData.has(`lineItems[${i}].description`)) { + while (formData.has(`lineItems[${i}].name`)) { lineItems.push({ - description: formData.get(`lineItems[${i}].description`) as string, + name: formData.get(`lineItems[${i}].name`) as string, + description: (formData.get(`lineItems[${i}].description`) as string) || undefined, quantity: Number(formData.get(`lineItems[${i}].quantity`)), unit: formData.get(`lineItems[${i}].unit`) as string, size: (formData.get(`lineItems[${i}].size`) as string) || undefined, @@ -104,7 +106,8 @@ export async function createPo( submittedAt: intent === "submit" ? new Date() : null, lineItems: { create: data.lineItems.map((item, idx) => ({ - description: item.description, + name: item.name, + description: item.description ?? null, quantity: item.quantity, unit: item.unit, size: item.size ?? null, diff --git a/App/pelagia-portal/app/(portal)/po/new/new-po-form.tsx b/App/pelagia-portal/app/(portal)/po/new/new-po-form.tsx index 9132181..38a1250 100644 --- a/App/pelagia-portal/app/(portal)/po/new/new-po-form.tsx +++ b/App/pelagia-portal/app/(portal)/po/new/new-po-form.tsx @@ -22,7 +22,7 @@ interface Props { export function NewPoForm({ vessels, accounts, vendors }: Props) { const router = useRouter(); const [lineItems, setLineItems] = useState([ - { description: "", quantity: 1, unit: "pc", size: "", unitPrice: 0, gstRate: 0.18 }, + { name: "", description: "", quantity: 1, unit: "pc", size: "", unitPrice: 0, gstRate: 0.18 }, ]); const [files, setFiles] = useState([]); const [submitting, setSubmitting] = useState<"draft" | "submit" | null>(null); @@ -35,7 +35,8 @@ export function NewPoForm({ vessels, accounts, vendors }: Props) { const data = new FormData(form); data.set("intent", intent); lineItems.forEach((item, i) => { - data.set(`lineItems[${i}].description`, item.description); + data.set(`lineItems[${i}].name`, item.name); + data.set(`lineItems[${i}].description`, item.description ?? ""); data.set(`lineItems[${i}].quantity`, String(item.quantity)); data.set(`lineItems[${i}].unit`, item.unit); data.set(`lineItems[${i}].size`, item.size ?? ""); diff --git a/App/pelagia-portal/app/(portal)/po/new/page.tsx b/App/pelagia-portal/app/(portal)/po/new/page.tsx index ff9e782..c0af659 100644 --- a/App/pelagia-portal/app/(portal)/po/new/page.tsx +++ b/App/pelagia-portal/app/(portal)/po/new/page.tsx @@ -22,7 +22,7 @@ export default async function NewPoPage() { ]); return ( -

+

New Purchase Order

diff --git a/App/pelagia-portal/app/api/po/[id]/export/route.ts b/App/pelagia-portal/app/api/po/[id]/export/route.ts index c1e8aa8..2f8efc5 100644 --- a/App/pelagia-portal/app/api/po/[id]/export/route.ts +++ b/App/pelagia-portal/app/api/po/[id]/export/route.ts @@ -56,7 +56,9 @@ export async function GET(request: NextRequest, { params }: Props) { const gstRate = Number((li as { gstRate?: unknown }).gstRate ?? 0.18); const taxable = Number(li.totalPrice); const gstAmt = taxable * gstRate; - return { sn: i + 1, desc: li.description, unit: li.unit, qty, unitPrice, gstRate, taxable, gstAmt, total: taxable + gstAmt }; + const li_ = li as typeof li & { name?: string }; + const desc = li_.name ?? li.description ?? ""; + return { sn: i + 1, desc, unit: li.unit, qty, unitPrice, gstRate, taxable, gstAmt, total: taxable + gstAmt }; }); const totalTaxable = items.reduce((s, i) => s + i.taxable, 0); diff --git a/App/pelagia-portal/components/po/po-detail.tsx b/App/pelagia-portal/components/po/po-detail.tsx index 1c6447f..d14fece 100644 --- a/App/pelagia-portal/components/po/po-detail.tsx +++ b/App/pelagia-portal/components/po/po-detail.tsx @@ -49,7 +49,8 @@ type PoWithRelations = { } | null; lineItems: { id: string; - description: string; + name: string; + description?: string | null; quantity: import("@prisma/client").Prisma.Decimal; unit: string; size?: string | null; @@ -87,7 +88,8 @@ const ACTION_LABELS: Record = { export async function PoDetail({ po, currentUserId, currentRole, readOnly = false }: Props) { const lineItemsForEditor = po.lineItems.map((li) => ({ - description: li.description, + name: li.name, + description: li.description ?? undefined, quantity: Number(li.quantity), unit: li.unit, size: li.size ?? undefined, diff --git a/App/pelagia-portal/components/po/po-line-items-editor.tsx b/App/pelagia-portal/components/po/po-line-items-editor.tsx index b00a469..e0f2466 100644 --- a/App/pelagia-portal/components/po/po-line-items-editor.tsx +++ b/App/pelagia-portal/components/po/po-line-items-editor.tsx @@ -40,6 +40,7 @@ interface Props { } type EditRow = { + name: string; description: string; quantity: string; unit: string; @@ -51,7 +52,8 @@ type EditRow = { function toEditRow(item: LineItemInput): EditRow { return { - description: item.description, + name: item.name, + description: item.description ?? "", quantity: String(item.quantity), unit: item.unit, size: item.size ?? "", @@ -63,7 +65,8 @@ function toEditRow(item: LineItemInput): EditRow { function toLineItem(row: EditRow): LineItemInput { return { - description: row.description, + name: row.name, + description: row.description || undefined, quantity: parseFloat(row.quantity) || 0, unit: row.unit, size: row.size || undefined, @@ -79,14 +82,16 @@ function calcTotals(items: LineItemInput[]) { return { taxable, gst, grand: taxable + gst }; } -function DescriptionCell({ - value, +function NameCell({ + name, + description, productId, onChange, }: { - value: string; + name: string; + description: string; productId?: string; - onChange: (desc: string, pid?: string, price?: number) => void; + onChange: (name: string, description: string, pid?: string, price?: number) => void; }) { const [hits, setHits] = useState([]); const [open, setOpen] = useState(false); @@ -103,8 +108,8 @@ function DescriptionCell({ return () => document.removeEventListener("mousedown", handleClick); }, []); - function handleInput(v: string) { - onChange(v, undefined); + function handleNameInput(v: string) { + onChange(v, description, undefined); if (timerRef.current) clearTimeout(timerRef.current); if (v.length < 2) { setHits([]); setOpen(false); return; } timerRef.current = setTimeout(async () => { @@ -120,49 +125,58 @@ function DescriptionCell({ } function select(hit: ProductHit) { - onChange(hit.name, hit.id, hit.lastPrice ?? undefined); + onChange(hit.name, hit.description ?? description, hit.id, hit.lastPrice ?? undefined); setOpen(false); setHits([]); } return ( -

- handleInput(e.target.value)} - onFocus={() => { if (hits.length > 0) setOpen(true); }} - className="w-full rounded border border-neutral-200 px-2 py-1.5 text-sm focus:border-primary-500 focus:outline-none" - placeholder="Item description" - /> - {productId && ( - - ✓ linked - - )} - {open && ( -
    - {hits.map((hit) => ( -
  • - -
  • - ))} -
- )} + + + ))} + + )} +
+ onChange(name, e.target.value, productId)} + className="w-full rounded border border-neutral-200 px-2 py-1 text-xs text-neutral-500 focus:border-primary-500 focus:outline-none" + placeholder="Description (optional)" + />
); } @@ -179,13 +193,14 @@ export function LineItemsEditor({ items, onChange, readOnly = false, originalIte updateRows(rows.map((row, i) => (i === index ? { ...row, [field]: value } : row))); } - function updateDescription(index: number, desc: string, productId?: string, price?: number) { + function updateNameCell(index: number, name: string, description: string, productId?: string, price?: number) { updateRows( rows.map((row, i) => { if (i !== index) return row; return { ...row, - description: desc, + name, + description, productId: productId ?? undefined, unitPrice: price != null ? String(price) : row.unitPrice, }; @@ -194,7 +209,7 @@ export function LineItemsEditor({ items, onChange, readOnly = false, originalIte } function add() { - updateRows([...rows, { description: "", quantity: "1", unit: "pc", size: "", unitPrice: "", gstRate: "0.18" }]); + updateRows([...rows, { name: "", description: "", quantity: "1", unit: "pc", size: "", unitPrice: "", gstRate: "0.18" }]); } function remove(index: number) { @@ -216,7 +231,7 @@ export function LineItemsEditor({ items, onChange, readOnly = false, originalIte - + {hasSize && } @@ -231,14 +246,17 @@ export function LineItemsEditor({ items, onChange, readOnly = false, originalIte const orig = originalItems?.[i]; const qtyChanged = orig && Number(orig.quantity) !== item.quantity; const priceChanged = orig && Number(orig.unitPrice) !== item.unitPrice; - const descChanged = orig && orig.description !== item.description; + const nameChanged = orig && orig.name !== item.name; const taxableAmt = item.quantity * item.unitPrice; const gstAmt = taxableAmt * (item.gstRate ?? 0.18); return (
DescriptionItem Qty UnitSize
- {descChanged && {orig.description}} - {item.description} + {nameChanged && {orig.name}} + {item.name} + {item.description && ( + {item.description} + )} {qtyChanged && {Number(orig.quantity)}} @@ -285,7 +303,7 @@ export function LineItemsEditor({ items, onChange, readOnly = false, originalIte - + @@ -302,10 +320,11 @@ export function LineItemsEditor({ items, onChange, readOnly = false, originalIte return (
DescriptionItem Qty Unit Size
- updateDescription(i, desc, pid, price)} + onChange={(name, description, pid, price) => updateNameCell(i, name, description, pid, price)} /> diff --git a/App/pelagia-portal/lib/po-import-parser.ts b/App/pelagia-portal/lib/po-import-parser.ts index 7264efb..b28f263 100644 --- a/App/pelagia-portal/lib/po-import-parser.ts +++ b/App/pelagia-portal/lib/po-import-parser.ts @@ -1,7 +1,7 @@ import * as XLSX from "xlsx"; export type ParsedImportLine = { - description: string; + name: string; unit: string; quantity: number; unitPrice: number; @@ -79,7 +79,7 @@ export function parseSheet(sheet: XLSX.WorkSheet): ParsedImport { const gstRate = gstRaw > 1 ? gstRaw / 100 : gstRaw; lineItems.push({ - description: desc, + name: desc, unit: unitRaw || "pc", quantity: qty || 1, unitPrice, diff --git a/App/pelagia-portal/lib/validations/po.ts b/App/pelagia-portal/lib/validations/po.ts index 82e78bf..ded2c73 100644 --- a/App/pelagia-portal/lib/validations/po.ts +++ b/App/pelagia-portal/lib/validations/po.ts @@ -1,7 +1,8 @@ import { z } from "zod"; export const lineItemSchema = z.object({ - description: z.string().min(1, "Description is required"), + name: z.string().min(1, "Item name is required"), + description: z.string().optional(), quantity: z.coerce.number().positive("Quantity must be positive"), unit: z.string().min(1, "Unit is required"), size: z.string().optional(), diff --git a/App/pelagia-portal/prisma/migrations/20260510215950_add_line_item_name/migration.sql b/App/pelagia-portal/prisma/migrations/20260510215950_add_line_item_name/migration.sql new file mode 100644 index 0000000..f1410e2 --- /dev/null +++ b/App/pelagia-portal/prisma/migrations/20260510215950_add_line_item_name/migration.sql @@ -0,0 +1,11 @@ +-- Add name column nullable first for backfill +ALTER TABLE "POLineItem" ADD COLUMN "name" TEXT; + +-- Backfill: copy existing description into name +UPDATE "POLineItem" SET "name" = "description"; + +-- Make name required +ALTER TABLE "POLineItem" ALTER COLUMN "name" SET NOT NULL; + +-- Make description optional +ALTER TABLE "POLineItem" ALTER COLUMN "description" DROP NOT NULL; diff --git a/App/pelagia-portal/prisma/schema.prisma b/App/pelagia-portal/prisma/schema.prisma index d939cfc..5dbc0c8 100644 --- a/App/pelagia-portal/prisma/schema.prisma +++ b/App/pelagia-portal/prisma/schema.prisma @@ -161,7 +161,8 @@ model PurchaseOrder { model POLineItem { id String @id @default(cuid()) - description String + name String + description String? quantity Decimal @db.Decimal(10, 3) unit String unitPrice Decimal @db.Decimal(12, 2) diff --git a/App/pelagia-portal/prisma/seed.ts b/App/pelagia-portal/prisma/seed.ts index 31d0cf9..ee512d2 100644 --- a/App/pelagia-portal/prisma/seed.ts +++ b/App/pelagia-portal/prisma/seed.ts @@ -571,9 +571,9 @@ async function main() { vendorId: vendor1.id, lineItems: { create: [ - { description: "Turbocharger seal kit", quantity: 2, unit: "set", unitPrice: 1200, totalPrice: 2400, sortOrder: 0, productId: prod1.id }, - { description: "High-pressure fuel pump", quantity: 1, unit: "pc", unitPrice: 4800, totalPrice: 4800, sortOrder: 1, productId: prod2.id }, - { description: "O-ring assortment pack", quantity: 5, unit: "pk", unitPrice: 250, totalPrice: 1250, sortOrder: 2 }, + { name: "Turbocharger seal kit", quantity: 2, unit: "set", unitPrice: 1200, totalPrice: 2400, sortOrder: 0, productId: prod1.id }, + { name: "High-pressure fuel pump", quantity: 1, unit: "pc", unitPrice: 4800, totalPrice: 4800, sortOrder: 1, productId: prod2.id }, + { name: "O-ring assortment pack", quantity: 5, unit: "pk", unitPrice: 250, totalPrice: 1250, sortOrder: 2 }, ], }, actions: { @@ -599,8 +599,8 @@ async function main() { accountId: acc2.id, lineItems: { create: [ - { description: "Life jackets (SOLAS)", quantity: 20, unit: "pc", unitPrice: 120, totalPrice: 2400, sortOrder: 0 }, - { description: "Fire extinguisher — 9kg", quantity: 4, unit: "pc", unitPrice: 200, totalPrice: 800, sortOrder: 1 }, + { name: "Life jackets (SOLAS)", quantity: 20, unit: "pc", unitPrice: 120, totalPrice: 2400, sortOrder: 0 }, + { name: "Fire extinguisher — 9kg", quantity: 4, unit: "pc", unitPrice: 200, totalPrice: 800, sortOrder: 1 }, ], }, actions: { @@ -625,7 +625,7 @@ async function main() { accountId: acc1.id, lineItems: { create: [ - { description: "INT chart folio update", quantity: 1, unit: "set", unitPrice: 950, totalPrice: 950, sortOrder: 0 }, + { name: "INT chart folio update", quantity: 1, unit: "set", unitPrice: 950, totalPrice: 950, sortOrder: 0 }, ], }, actions: {