forked from jappel/leistungsbilanz-ts
Add project revision foundation
This commit is contained in:
parent
6b6d2c2a42
commit
903d977443
16 changed files with 2052 additions and 9 deletions
43
src/domain/ports/project-revision.store.ts
Normal file
43
src/domain/ports/project-revision.store.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
export type ProjectRevisionSource =
|
||||
| "user"
|
||||
| "undo"
|
||||
| "redo"
|
||||
| "restore"
|
||||
| "migration";
|
||||
|
||||
export type ProjectChangeJsonValue =
|
||||
| null
|
||||
| boolean
|
||||
| number
|
||||
| string
|
||||
| ProjectChangeJsonValue[]
|
||||
| { [key: string]: ProjectChangeJsonValue };
|
||||
|
||||
export interface ProjectChangePayload {
|
||||
schemaVersion: number;
|
||||
data: ProjectChangeJsonValue;
|
||||
}
|
||||
|
||||
export interface AppendProjectRevisionInput {
|
||||
projectId: string;
|
||||
expectedRevision: number;
|
||||
source: ProjectRevisionSource;
|
||||
commandType: string;
|
||||
description?: string;
|
||||
actorId?: string;
|
||||
forward: ProjectChangePayload;
|
||||
inverse: ProjectChangePayload;
|
||||
}
|
||||
|
||||
export interface AppendedProjectRevision {
|
||||
revisionId: string;
|
||||
changeSetId: string;
|
||||
projectId: string;
|
||||
revisionNumber: number;
|
||||
createdAtIso: string;
|
||||
}
|
||||
|
||||
export interface ProjectRevisionStore {
|
||||
getCurrentRevision(projectId: string): number | null;
|
||||
append(input: AppendProjectRevisionInput): AppendedProjectRevision;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue