fase(1): shared domain building blocks
This commit is contained in:
17
dist/shared/domain/Entity.js
vendored
Normal file
17
dist/shared/domain/Entity.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Entity = void 0;
|
||||
const UniqueId_1 = require("./UniqueId");
|
||||
class Entity {
|
||||
constructor(props, id) {
|
||||
this._id = id ?? UniqueId_1.UniqueId.create();
|
||||
this.props = props;
|
||||
}
|
||||
get id() { return this._id; }
|
||||
equals(other) {
|
||||
if (!other)
|
||||
return false;
|
||||
return this._id.equals(other._id);
|
||||
}
|
||||
}
|
||||
exports.Entity = Entity;
|
||||
Reference in New Issue
Block a user