Files
goodgo-platform/apps/api/src/modules/auth/presentation/dto/update-profile.dto.ts
Ho Ngoc Hai 74c52198b3 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>
2026-04-15 22:34:40 +07:00

25 lines
725 B
TypeScript

import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsEmail, IsOptional, IsString, IsUrl, MinLength } from 'class-validator';
export class UpdateProfileDto {
@ApiPropertyOptional({ example: 'Nguyen Van A', description: 'Full name' })
@IsOptional()
@IsString()
@MinLength(1)
fullName?: string;
@ApiPropertyOptional({
example: 'https://cdn.goodgo.vn/avatars/user-123.jpg',
description: 'Avatar URL',
})
@IsOptional()
@IsString()
@IsUrl({}, { message: 'Avatar URL không hợp lệ' })
avatarUrl?: string;
@ApiPropertyOptional({ example: 'user@example.com', description: 'Email address' })
@IsOptional()
@IsEmail({}, { message: 'Email không hợp lệ' })
email?: string;
}