forked from jappel/leistungsbilanz-ts
Add configurable distribution supply types
This commit is contained in:
parent
194bc9c0b1
commit
b1a11397b3
43 changed files with 5697 additions and 126 deletions
|
|
@ -226,6 +226,7 @@ export function updateProjectSettings(
|
|||
description: string | null;
|
||||
singlePhaseVoltageV: number;
|
||||
threePhaseVoltageV: number;
|
||||
enabledDistributionBoardSupplyTypes: ProjectDto["enabledDistributionBoardSupplyTypes"];
|
||||
}
|
||||
) {
|
||||
return request<ProjectSettingsCommandResultDto>(
|
||||
|
|
@ -276,14 +277,36 @@ export function listDistributionBoards(projectId: string) {
|
|||
|
||||
export function createDistributionBoard(
|
||||
projectId: string,
|
||||
name: string,
|
||||
input: {
|
||||
name: string;
|
||||
floorId: string | null;
|
||||
supplyType: NonNullable<DistributionBoardDto["supplyType"]>;
|
||||
},
|
||||
expectedRevision: number
|
||||
) {
|
||||
return request<DistributionBoardCommandResultDto>(
|
||||
`/api/projects/${projectId}/distribution-boards`,
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify({ name, expectedRevision }),
|
||||
body: JSON.stringify({ ...input, expectedRevision }),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function updateDistributionBoard(
|
||||
projectId: string,
|
||||
distributionBoardId: string,
|
||||
input: {
|
||||
floorId: string | null;
|
||||
supplyType: NonNullable<DistributionBoardDto["supplyType"]>;
|
||||
},
|
||||
expectedRevision: number
|
||||
) {
|
||||
return request<DistributionBoardCommandResultDto>(
|
||||
`/api/projects/${projectId}/distribution-boards/${distributionBoardId}`,
|
||||
{
|
||||
method: "PUT",
|
||||
body: JSON.stringify({ ...input, expectedRevision }),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ const commandTypeLabels: Record<string, string> = {
|
|||
"project-device.sync-rows": "Projektgerät-Verknüpfungen geändert",
|
||||
"project.update-settings": "Projekteinstellungen bearbeitet",
|
||||
"distribution-board.insert": "Verteilung angelegt",
|
||||
"distribution-board.update": "Verteilung bearbeitet",
|
||||
"distribution-board.delete": "Verteilung entfernt",
|
||||
"project-floor.insert": "Geschoss angelegt",
|
||||
"project-floor.delete": "Geschoss entfernt",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue