data and layout cleanup

This commit is contained in:
2026-03-15 21:26:08 -05:00
parent ac0c6e4365
commit 8029b308e9
4 changed files with 19 additions and 160 deletions

View File

@@ -122,152 +122,4 @@ export async function bootstrapAppData() {
},
});
}
if ((await prisma.customer.count()) === 0) {
await prisma.customer.createMany({
data: [
{
name: "Acme Components",
email: "buyer@acme.example",
phone: "555-0101",
addressLine1: "1 Industrial Road",
addressLine2: "",
city: "Detroit",
state: "MI",
postalCode: "48201",
country: "USA",
notes: "Priority account",
},
{
name: "Northwind Fabrication",
email: "ops@northwind.example",
phone: "555-0120",
addressLine1: "42 Assembly Ave",
addressLine2: "",
city: "Milwaukee",
state: "WI",
postalCode: "53202",
country: "USA",
notes: "Requires ASN notice",
},
],
});
}
if ((await prisma.vendor.count()) === 0) {
await prisma.vendor.create({
data: {
name: "SteelSource Supply",
email: "sales@steelsource.example",
phone: "555-0142",
addressLine1: "77 Mill Street",
addressLine2: "",
city: "Gary",
state: "IN",
postalCode: "46402",
country: "USA",
notes: "Lead time 5 business days",
},
});
}
if ((await prisma.inventoryItem.count()) === 0) {
const plate = await prisma.inventoryItem.create({
data: {
sku: "RM-PLATE-AL-125",
name: "Aluminum Plate 1/8in",
description: "Raw aluminum plate stock for fabricated assemblies.",
type: "PURCHASED",
status: "ACTIVE",
unitOfMeasure: "EA",
isSellable: false,
isPurchasable: true,
defaultCost: 42.5,
defaultPrice: null,
notes: "Primary sheet stock for enclosure fabrication.",
},
});
const fastener = await prisma.inventoryItem.create({
data: {
sku: "HW-SCREW-832",
name: "8-32 Socket Head Screw",
description: "Standard socket head cap screw for enclosure assemblies.",
type: "PURCHASED",
status: "ACTIVE",
unitOfMeasure: "EA",
isSellable: false,
isPurchasable: true,
defaultCost: 0.18,
defaultPrice: null,
notes: "Bulk hardware item.",
},
});
const assembly = await prisma.inventoryItem.create({
data: {
sku: "FG-CTRL-BASE",
name: "Control Base Assembly",
description: "Base enclosure assembly for standard control packages.",
type: "ASSEMBLY",
status: "ACTIVE",
unitOfMeasure: "EA",
isSellable: true,
isPurchasable: false,
defaultCost: 118,
defaultPrice: 249,
notes: "Starter BOM for the inventory foundation slice.",
},
});
await prisma.inventoryBomLine.createMany({
data: [
{
parentItemId: assembly.id,
componentItemId: plate.id,
quantity: 2,
unitOfMeasure: "EA",
notes: "Side panel blanks",
position: 10,
},
{
parentItemId: assembly.id,
componentItemId: fastener.id,
quantity: 12,
unitOfMeasure: "EA",
notes: "General assembly hardware",
position: 20,
},
],
});
}
if ((await prisma.warehouse.count()) === 0) {
await prisma.warehouse.create({
data: {
code: "MAIN",
name: "Main Warehouse",
notes: "Primary stocking location for finished goods and purchased materials.",
locations: {
create: [
{
code: "RECV",
name: "Receiving",
notes: "Initial inbound inspection and receipt staging.",
},
{
code: "STOCK-A1",
name: "Aisle A1",
notes: "General rack storage for standard material.",
},
{
code: "FG-STAGE",
name: "Finished Goods Staging",
notes: "Outbound-ready finished assemblies.",
},
],
},
},
});
}
}