Added 1B, 2 and added bootstrap again for site
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user