feat: add user createOne and refactor code

This commit is contained in:
2026-02-23 09:19:34 +03:30
parent 72a001a150
commit 63b4567166
13 changed files with 192 additions and 110 deletions
+3 -1
View File
@@ -4,7 +4,7 @@ import { Transform } from 'class-transformer';
import { IsNotEmpty, IsOptional, IsString, Matches } from 'class-validator';
import { i18nValidationMessage as t } from 'nestjs-i18n';
export class LoginDTO {
export class PhoneDTO {
@ApiProperty({
type: 'string',
description: `User's Phone Number`,
@@ -24,7 +24,9 @@ export class LoginDTO {
})
@Transform(({ value }) => Utils.StringUtils.normalizePhone(value as string))
phone: string;
}
export class LoginDTO extends PhoneDTO {
@ApiProperty({
type: 'string',
description: 'Password for User Account',
+13
View File
@@ -0,0 +1,13 @@
import { IsNotEmpty, IsString } from 'class-validator';
import { PhoneDTO } from './login.dto';
import { i18nValidationMessage as t } from 'nestjs-i18n';
export class VerifyOtpDTO extends PhoneDTO {
@IsString()
@IsNotEmpty({
message: t('validation.requiredField', {
field: '$t(auth.fields.otp)',
}),
})
otp: string;
}