QoL changes and additions
Build and Push Docker Image / build (push) Successful in 45s

This commit is contained in:
jason
2026-04-22 13:16:42 -05:00
parent a165428f14
commit 04ae88ca0d
14 changed files with 1424 additions and 29 deletions
@@ -31,6 +31,10 @@ export default async function AdminPartDetailPage({
include: {
machine: { select: { id: true, name: true } },
template: { select: { id: true, name: true } },
timeLogs: {
orderBy: { startedAt: "desc" },
include: { operator: { select: { id: true, name: true } } },
},
},
},
},
@@ -55,6 +59,20 @@ export default async function AdminPartDetailPage({
]);
if (!part) notFound();
// QC history across every op on the part — newest first. Same data feeds
// two views: the "QC history" strip on the part page and the failure-digest
// on the admin dashboard. Keeping it to the last 50 per part is plenty for
// any realistic production run.
const qcRecords = await prisma.qCRecord.findMany({
where: { operation: { partId: part.id } },
orderBy: { createdAt: "desc" },
take: 50,
include: {
operator: { select: { id: true, name: true } },
operation: { select: { id: true, sequence: true, name: true } },
},
});
const fileView = (f: typeof part.stepFile) =>
f
? {
@@ -99,6 +117,14 @@ export default async function AdminPartDetailPage({
plannedUnits: op.plannedUnits,
status: op.status,
qrToken: op.qrToken,
timeLogs: op.timeLogs.map((l) => ({
id: l.id,
startedAt: l.startedAt.toISOString(),
endedAt: l.endedAt ? l.endedAt.toISOString() : null,
unitsProcessed: l.unitsProcessed,
note: l.note,
operatorName: l.operator.name,
})),
}))}
machines={machines}
templates={templates.map((t) => ({
@@ -109,6 +135,17 @@ export default async function AdminPartDetailPage({
defaultInstructions: t.defaultInstructions,
qcRequired: t.qcRequired,
}))}
qcRecords={qcRecords.map((r) => ({
id: r.id,
kind: r.kind,
passed: r.passed,
notes: r.notes,
measurements: r.measurements,
createdAt: r.createdAt.toISOString(),
operatorName: r.operator.name,
operationSequence: r.operation.sequence,
operationName: r.operation.name,
}))}
/>
);
}