feat(auth): add PATCH /auth/profile endpoint for user profile updates
Implement user profile update with fullName, avatarUrl, and email fields. Email changes include uniqueness validation and Email VO verification. Follows existing DDD/CQRS patterns with cache invalidation. 19 unit tests covering handler logic and DTO validation. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -138,4 +138,11 @@ export class UserEntity extends AggregateRoot<string> {
|
||||
this._totpBackupCodes = this._totpBackupCodes.filter((_, i) => i !== index);
|
||||
this.updatedAt = new Date();
|
||||
}
|
||||
|
||||
updateProfile(fullName?: string, avatarUrl?: string | null, email?: Email | null): void {
|
||||
if (fullName !== undefined) this._fullName = fullName;
|
||||
if (avatarUrl !== undefined) this._avatarUrl = avatarUrl;
|
||||
if (email !== undefined) this._email = email;
|
||||
this.updatedAt = new Date();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user