stage 5-6
Build and Push Docker Image / build (push) Successful in 1m11s

This commit is contained in:
jason
2026-04-21 13:14:27 -05:00
parent fc5bce4868
commit 5847a175af
26 changed files with 3031 additions and 29 deletions
@@ -0,0 +1,60 @@
import { notFound } from "next/navigation";
import { prisma } from "@/lib/prisma";
import POClient from "./POClient";
export const dynamic = "force-dynamic";
export default async function POPage({
params,
}: {
params: Promise<{ id: string; poId: string }>;
}) {
const { id: projectId, poId } = await params;
const project = await prisma.project.findUnique({
where: { id: projectId },
select: { id: true, code: true, name: true },
});
if (!project) notFound();
const po = await prisma.purchaseOrder.findUnique({
where: { id: poId },
include: {
lines: {
include: {
fastener: {
select: {
id: true,
partNumber: true,
description: true,
supplier: true,
unitCost: true,
},
},
},
},
},
});
if (!po || po.projectId !== projectId) notFound();
return (
<POClient
project={project}
po={{
id: po.id,
vendor: po.vendor,
status: po.status,
createdAt: po.createdAt.toISOString(),
sentAt: po.sentAt?.toISOString() ?? null,
receivedAt: po.receivedAt?.toISOString() ?? null,
notes: po.notes,
}}
lines={po.lines.map((l) => ({
id: l.id,
fastener: l.fastener,
qty: l.qty,
receivedQty: l.receivedQty,
unitCost: l.unitCost,
}))}
/>
);
}