forked from jappel/leistungsbilanz-ts
Add project command API
This commit is contained in:
parent
1e4dd26bb8
commit
e4c7cf06e9
19 changed files with 781 additions and 21 deletions
33
src/domain/ports/project-command.executor.ts
Normal file
33
src/domain/ports/project-command.executor.ts
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import type { AppendedProjectRevision } from "./project-revision.store.js";
|
||||
import type { ProjectHistoryState } from "./project-history.store.js";
|
||||
|
||||
export interface ExecuteUserProjectCommandInput {
|
||||
projectId: string;
|
||||
expectedRevision: number;
|
||||
description?: string;
|
||||
actorId?: string;
|
||||
command: unknown;
|
||||
}
|
||||
|
||||
export interface ExecuteProjectHistoryCommandInput {
|
||||
projectId: string;
|
||||
expectedRevision: number;
|
||||
actorId?: string;
|
||||
}
|
||||
|
||||
export interface ExecutedProjectCommand {
|
||||
revision: AppendedProjectRevision;
|
||||
history: ProjectHistoryState;
|
||||
}
|
||||
|
||||
export interface ProjectCommandExecutor {
|
||||
executeUser(
|
||||
input: ExecuteUserProjectCommandInput
|
||||
): ExecutedProjectCommand;
|
||||
undo(
|
||||
input: ExecuteProjectHistoryCommandInput
|
||||
): ExecutedProjectCommand;
|
||||
redo(
|
||||
input: ExecuteProjectHistoryCommandInput
|
||||
): ExecutedProjectCommand;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue