This commit is contained in:
Rayyan Syahbani Hermanto
2026-09-07 22:57:18 +07:00
parent fdbfb34842
commit 1bba2b518e
101 changed files with 2503 additions and 8 deletions
+37
View File
@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.User = void 0;
class User {
id;
name;
email;
password;
metadata;
constructor(id, name, email, password, metadata) {
this.id = id;
this.name = name;
this.email = email;
this.password = password;
this.metadata = metadata;
}
static create(data) {
return new User(crypto.randomUUID(), data.name, data.email, data.password, data.metadata);
}
delete() {
// Business Rule
}
changeEmail(email) {
this.email = email;
}
changeName(name) {
this.name = name;
}
changePassword(newPassword) {
this.password = newPassword;
}
static restore(data) {
return new User(data.id, data.name, data.email, data.password, data.metadata);
}
}
exports.User = User;
//# sourceMappingURL=user.entity.js.map