We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 698bea4 commit c90bccdCopy full SHA for c90bccd
src/shared/core/AggregateRoot.ts
@@ -0,0 +1,17 @@
1
+interface AggregateObjectProps {
2
+ [index: string]: any;
3
+}
4
+
5
+export abstract class AggregateRoot<T extends AggregateObjectProps> {
6
+ public props: T;
7
+ protected readonly _id: number;
8
9
+ protected constructor(props: T, id: number) {
10
+ this.props = { ...props };
11
+ this._id = id;
12
+ }
13
14
+ get id(): number {
15
+ return this._id;
16
17
0 commit comments