feat(application): complete dispo import operator flow

This commit is contained in:
2026-03-14 15:14:55 +01:00
parent 6a2f552ccb
commit 4dabb9d4ce
11 changed files with 1034 additions and 32 deletions
@@ -0,0 +1,48 @@
import assert from "node:assert/strict";
import test from "node:test";
import { parseImportDispoBatchArgs } from "./import-dispo-batch.js";
test("parseImportDispoBatchArgs uses the agreed workbook defaults", () => {
const options = parseImportDispoBatchArgs([]);
assert.equal(options.allowTbdUnresolved, true);
assert.equal(options.skipCommit, false);
assert.equal(options.strictSourceData, false);
assert.equal(options.previewUnresolvedLimit, 10);
assert.match(options.referenceWorkbookPath, /MandatoryDispoCategories_V3\.xlsx$/u);
assert.match(options.planningWorkbookPath, /DISPO_2026\.xlsx$/u);
assert.match(
options.chargeabilityWorkbookPath,
/20260309_Bi-Weekly_Chargeability_Reporting_Content_Production_V0\.943_4Hartmut\.xlsx$/u,
);
assert.match(options.rosterWorkbookPath ?? "", /MV_DispoRoster\.xlsx$/u);
assert.match(
options.costWorkbookPath ?? "",
/Resource Roster_MASTER_FY26_CJ_20251201\.xlsx$/u,
);
});
test("parseImportDispoBatchArgs applies operator overrides", () => {
const options = parseImportDispoBatchArgs([
"--planning-workbook",
"./custom-planning.xlsx",
"--notes",
"live test",
"--preview-unresolved",
"25",
"--skip-commit",
"--strict-source-data",
"--disallow-tbd",
"--no-roster",
"--no-cost",
]);
assert.match(options.planningWorkbookPath, /custom-planning\.xlsx$/u);
assert.equal(options.notes, "live test");
assert.equal(options.previewUnresolvedLimit, 25);
assert.equal(options.skipCommit, true);
assert.equal(options.strictSourceData, true);
assert.equal(options.allowTbdUnresolved, false);
assert.equal(options.rosterWorkbookPath, undefined);
assert.equal(options.costWorkbookPath, undefined);
});