feat: add user createOne and refactor code
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user