Bot
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user