feat: add field validators for username and password, and integrate them into DTOs

This commit is contained in:
2026-05-19 20:34:05 +03:30
parent d526f6ed2c
commit 98099e97e7
17 changed files with 136 additions and 33 deletions
@@ -1,13 +1,16 @@
import { PasswordFieldValidator, UsernameFieldValidator } from '@/common/utils'
import { ApiProperty, PartialType } from '@nestjs/swagger'
import { IsEnum, IsOptional, IsString } from 'class-validator'
import { AccountStatus } from 'generated/prisma/enums'
export class CreateConsumerAccountDto {
@IsString()
@UsernameFieldValidator()
@ApiProperty({ required: true })
username: string
@IsString()
@PasswordFieldValidator()
@ApiProperty({ required: true })
password: string