Added 1B, 2 and added bootstrap again for site

This commit is contained in:
2026-05-03 22:04:45 +02:00
parent b8995b3a1b
commit d1ce485572
37 changed files with 1842 additions and 89 deletions
+30
View File
@@ -0,0 +1,30 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { CircuitNumberingService } from "../src/domain/services/circuit-numbering.service.js";
describe("circuit numbering service", () => {
it("uses highest numeric suffix + 1 and does not fill gaps", async () => {
const service = new CircuitNumberingService({
sectionRepository: {
async findById() {
return { id: "s1", prefix: "-2F" } as never;
},
},
circuitRepository: {
async listBySection() {
return [
{ equipmentIdentifier: "-2F1" },
{ equipmentIdentifier: "-2F2" },
{ equipmentIdentifier: "-2F5" },
{ equipmentIdentifier: "-2FX" },
{ equipmentIdentifier: "-1F9" },
] as never[];
},
},
});
const next = await service.getNextIdentifier("s1");
assert.equal(next, "-2F6");
});
});