Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JBBianchi committed Dec 19, 2023
2 parents 19b5efe + aa9a7e1 commit d18329f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions projects/neuroglia/integration/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from './integration-event.interface';
export * from './integration-event';
export * from './patch-operation';
export * from './json-patch';
export * from './patch-command';
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface IIntegrationEvent<T = string> {
/** The id of the aggregate, if any, that has produced the event */
aggregateId: T;
/** The version of the event's source aggregate, if any, at the time it produced the event */
aggregateVersion: string;
aggregateVersion: number;
/** The type of the originating intergration event */
type: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class IntegrationEvent<T = string> extends DataTransferObject implements
/** The id of the aggregate, if any, that has produced the event */
aggregateId: T;
/** The version of the event's source aggregate, if any, at the time it produced the event */
aggregateVersion: string;
aggregateVersion: number;
/** The type of the originating intergration event */
type: string;
}
17 changes: 17 additions & 0 deletions projects/neuroglia/integration/src/lib/patch-command.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { DataTransferObject } from './data-transfer-object';
import { JsonPatch } from './json-patch';

/**
* Represents the command used to patch the specified aggregate
*/
export class PatchCommand extends DataTransferObject {
/** The id of the aggregate to patch */
id!: string;
/** The patch to apply */
patch!: JsonPatch;

constructor(model?: Partial<PatchCommand>) {
super(model);
this.patch = new JsonPatch(model?.patch || {});
}
}

0 comments on commit d18329f

Please sign in to comment.