Initial catalog maker baseline

This commit is contained in:
2026-08-05 12:25:23 +02:00
commit 2e7d83b679
30 changed files with 5437 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
import fs from "node:fs";
import { info, warn } from "../lib/log.js";
const steps = [
{
id: "load-context",
title: "Load workbook and local configuration",
status: "planned",
},
{
id: "load-manufacturer",
title: "Load selected manufacturer and products to process",
status: "needs-mapping",
},
{
id: "check-stock",
title: "Check supplier stock and existing catalog combinations",
status: "needs-mapping",
},
{
id: "build-combinations",
title: "Create or update product combinations",
status: "needs-mapping",
},
{
id: "update-prices",
title: "Update product and combination prices",
status: "needs-mapping",
},
{
id: "update-texts",
title: "Generate/update product card texts",
status: "needs-mapping",
},
{
id: "handle-pictures",
title: "Resolve cover/detail product pictures",
status: "needs-mapping",
},
];
export async function runCatalogMaker({ config }) {
info("Catalog maker workflow");
info(`Mode: ${config.dryRun ? "dry-run" : "live"}`);
info(`Workbook: ${config.sourceWorkbook}`);
if (!fs.existsSync(config.sourceWorkbook)) {
throw new Error(`Source workbook not found: ${config.sourceWorkbook}`);
}
info("");
info("Planned replacement for Excel button: Catalog maker - 20");
for (const step of steps) {
const marker = step.status === "planned" ? "ready" : step.status;
info(`- ${step.id}: ${marker} - ${step.title}`);
}
warn("");
warn("No database or catalog changes were made. Database access in this project is read-only by rule #1.");
warn("Next step: map the original VBA/SQL behavior for CommandButton20_Click.");
}