Renumber circuit groups explicitly

This commit is contained in:
2026-07-31 07:53:07 +02:00
parent 0cb280ddb2
commit be9c6f0d52
6 changed files with 347 additions and 1 deletions
+21
View File
@@ -62,6 +62,9 @@ import type {
import type {
CircuitProtectionSnapshot,
} from "../../domain/models/circuit-protection-project-command.model";
import type {
CircuitGroupRenumberPlan,
} from "../../domain/services/circuit-group-renumbering";
async function request<T>(url: string, init?: RequestInit): Promise<T> {
const response = await fetch(url, {
@@ -452,6 +455,24 @@ export function reorderCircuitGroupsCommand(
);
}
export function renumberCircuitGroupsCommand(
projectId: string,
expectedRevision: number,
circuitListId: string,
plan: CircuitGroupRenumberPlan
) {
return executeProjectCommand(
projectId,
expectedRevision,
{
schemaVersion: 1,
type: "circuit-group.renumber",
payload: { circuitListId, groups: plan.groups },
},
"Stromkreisgruppen neu nummerieren"
);
}
export function updateCircuitProtectionCommand(
projectId: string,
expectedRevision: number,