Add external object new circuit command

This commit is contained in:
Julian Appel 2026-08-02 18:55:57 +02:00
parent 347b3717c3
commit a69b7b603f
13 changed files with 880 additions and 228 deletions

View file

@ -182,6 +182,12 @@ import {
externalObjectDeleteCreatedRowCommandType,
} from "../models/external-object-new-row-project-command.model.js";
import type { ExternalObjectNewRowProjectCommandStore } from "../ports/external-object-new-row-project-command.store.js";
import {
assertExternalObjectNewCircuitProjectCommand,
externalObjectAssignToNewCircuitCommandType,
externalObjectDeleteCreatedCircuitCommandType,
} from "../models/external-object-new-circuit-project-command.model.js";
import type { ExternalObjectNewCircuitProjectCommandStore } from "../ports/external-object-new-circuit-project-command.store.js";
interface DispatchProjectCommandInput {
projectId: string;
@ -220,7 +226,8 @@ export class ProjectCommandService implements ProjectCommandExecutor {
private readonly externalCsvConfigurationStore?: ExternalCsvConfigurationProjectCommandStore,
private readonly externalInitialImportStore?: ExternalInitialImportProjectCommandStore,
private readonly externalObjectRowAssignmentStore?: ExternalObjectRowAssignmentProjectCommandStore,
private readonly externalObjectNewRowStore?: ExternalObjectNewRowProjectCommandStore
private readonly externalObjectNewRowStore?: ExternalObjectNewRowProjectCommandStore,
private readonly externalObjectNewCircuitStore?: ExternalObjectNewCircuitProjectCommandStore
) {}
executeUser(
@ -618,6 +625,17 @@ export class ProjectCommandService implements ProjectCommandExecutor {
command: input.command,
}).revision;
}
case externalObjectAssignToNewCircuitCommandType:
case externalObjectDeleteCreatedCircuitCommandType: {
assertExternalObjectNewCircuitProjectCommand(input.command);
if (!this.externalObjectNewCircuitStore) {
throw new Error("External object new-circuit store is not available.");
}
return this.externalObjectNewCircuitStore.execute({
...input,
command: input.command,
}).revision;
}
case projectStateRestoreCommandType: {
assertProjectStateRestoreCommand(input.command);
return this.projectStateRestoreStore.execute({