forked from jappel/leistungsbilanz-ts
Add recursive distribution board load projection
This commit is contained in:
parent
855a04e655
commit
dfeb0e3cb6
11 changed files with 701 additions and 138 deletions
|
|
@ -38,13 +38,15 @@ describe("circuit tree controller", () => {
|
|||
it("returns header, grouped and footer components with both protection layers", async () => {
|
||||
const originals = {
|
||||
findList: circuitListRepository.findById,
|
||||
listLists: circuitListRepository.listByProject,
|
||||
findProject: projectRepository.findById,
|
||||
findBoard: distributionBoardRepository.findById,
|
||||
listSections: circuitSectionRepository.listByCircuitList,
|
||||
listCircuits: circuitRepository.listByCircuitList,
|
||||
listBoards: distributionBoardRepository.listByProject,
|
||||
listSections: circuitSectionRepository.listByCircuitLists,
|
||||
listCircuits: circuitRepository.listByCircuitLists,
|
||||
listRows: circuitDeviceRowRepository.listByCircuitList,
|
||||
listComponents:
|
||||
distributionBoardComponentRepository.listByCircuitList,
|
||||
distributionBoardComponentRepository.listByCircuitLists,
|
||||
listComponentProtection:
|
||||
distributionBoardComponentRepository.listProtectionByComponentIds,
|
||||
listCircuitProtection:
|
||||
|
|
@ -57,6 +59,13 @@ describe("circuit tree controller", () => {
|
|||
distributionBoardId: "board-1",
|
||||
name: "UV-01",
|
||||
}) as never;
|
||||
circuitListRepository.listByProject = async () =>
|
||||
[{
|
||||
id: "list-1",
|
||||
projectId: "project-1",
|
||||
distributionBoardId: "board-1",
|
||||
name: "UV-01",
|
||||
}] as never;
|
||||
projectRepository.findById = async () =>
|
||||
({
|
||||
id: "project-1",
|
||||
|
|
@ -66,8 +75,19 @@ describe("circuit tree controller", () => {
|
|||
threePhaseVoltageV: 400,
|
||||
}) as never;
|
||||
distributionBoardRepository.findById = async () =>
|
||||
({ id: "board-1", simultaneityFactor: 0.8 }) as never;
|
||||
circuitSectionRepository.listByCircuitList = async () =>
|
||||
({ id: "board-1", name: "UV-01", simultaneityFactor: 0.8 }) as never;
|
||||
distributionBoardRepository.listByProject = async () =>
|
||||
[{
|
||||
id: "board-1",
|
||||
projectId: "project-1",
|
||||
name: "UV-01",
|
||||
boardNumber: "UV-01",
|
||||
supplyType: "AV",
|
||||
simultaneityFactor: 0.8,
|
||||
feedingDistributionBoardId: null,
|
||||
feedingCircuitId: null,
|
||||
}] as never;
|
||||
circuitSectionRepository.listByCircuitLists = async () =>
|
||||
[
|
||||
{
|
||||
id: "group-1",
|
||||
|
|
@ -80,7 +100,7 @@ describe("circuit tree controller", () => {
|
|||
groupNumber: 1,
|
||||
},
|
||||
] as never;
|
||||
circuitRepository.listByCircuitList = async () =>
|
||||
circuitRepository.listByCircuitLists = async () =>
|
||||
[
|
||||
{
|
||||
id: "circuit-1",
|
||||
|
|
@ -90,10 +110,19 @@ describe("circuit tree controller", () => {
|
|||
displayName: "Licht",
|
||||
sortOrder: 10,
|
||||
isReserve: 0,
|
||||
cableType: null,
|
||||
cableCrossSection: null,
|
||||
cableLength: null,
|
||||
rcdAssignment: null,
|
||||
terminalDesignation: null,
|
||||
voltage: 230,
|
||||
controlRequirement: null,
|
||||
status: null,
|
||||
remark: null,
|
||||
},
|
||||
] as never;
|
||||
circuitDeviceRowRepository.listByCircuitList = async () => [];
|
||||
distributionBoardComponentRepository.listByCircuitList =
|
||||
distributionBoardComponentRepository.listByCircuitLists =
|
||||
async () =>
|
||||
[
|
||||
{
|
||||
|
|
@ -170,13 +199,15 @@ describe("circuit tree controller", () => {
|
|||
);
|
||||
} finally {
|
||||
circuitListRepository.findById = originals.findList;
|
||||
circuitListRepository.listByProject = originals.listLists;
|
||||
projectRepository.findById = originals.findProject;
|
||||
distributionBoardRepository.findById = originals.findBoard;
|
||||
circuitSectionRepository.listByCircuitList =
|
||||
distributionBoardRepository.listByProject = originals.listBoards;
|
||||
circuitSectionRepository.listByCircuitLists =
|
||||
originals.listSections;
|
||||
circuitRepository.listByCircuitList = originals.listCircuits;
|
||||
circuitRepository.listByCircuitLists = originals.listCircuits;
|
||||
circuitDeviceRowRepository.listByCircuitList = originals.listRows;
|
||||
distributionBoardComponentRepository.listByCircuitList =
|
||||
distributionBoardComponentRepository.listByCircuitLists =
|
||||
originals.listComponents;
|
||||
distributionBoardComponentRepository.listProtectionByComponentIds =
|
||||
originals.listComponentProtection;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue