mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 21:59:40 +00:00
add login flow for waiting list demo app
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsBoolean, IsDateString, IsEnum, IsNotEmpty, IsString, IsUUID } from 'class-validator';
|
||||
import { IsBoolean, IsDateString, IsEnum, IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator';
|
||||
import { i18nValidationMessage as i18n } from 'nestjs-i18n';
|
||||
import { IsAbove18 } from '~/core/decorators/validations';
|
||||
import { Gender } from '~/customer/enums';
|
||||
@ -16,7 +16,8 @@ export class CreateCustomerRequestDto {
|
||||
|
||||
@ApiProperty({ example: 'MALE' })
|
||||
@IsEnum(Gender, { message: i18n('validation.IsEnum', { path: 'general', property: 'customer.gender' }) })
|
||||
gender!: Gender;
|
||||
@IsOptional()
|
||||
gender?: Gender;
|
||||
|
||||
@ApiProperty({ example: 'JO' })
|
||||
@IsString({ message: i18n('validation.IsString', { path: 'general', property: 'customer.countryOfResidence' }) })
|
||||
@ -31,39 +32,47 @@ export class CreateCustomerRequestDto {
|
||||
@ApiProperty({ example: '999300024' })
|
||||
@IsString({ message: i18n('validation.IsString', { path: 'general', property: 'customer.nationalId' }) })
|
||||
@IsNotEmpty({ message: i18n('validation.IsNotEmpty', { path: 'general', property: 'customer.nationalId' }) })
|
||||
nationalId!: string;
|
||||
@IsOptional()
|
||||
nationalId?: string;
|
||||
|
||||
@ApiProperty({ example: '2021-01-01' })
|
||||
@IsDateString(
|
||||
{},
|
||||
{ message: i18n('validation.IsDateString', { path: 'general', property: 'junior.nationalIdExpiry' }) },
|
||||
)
|
||||
nationalIdExpiry!: Date;
|
||||
@IsOptional()
|
||||
nationalIdExpiry?: Date;
|
||||
|
||||
@ApiProperty({ example: 'Employee' })
|
||||
@IsString({ message: i18n('validation.IsString', { path: 'general', property: 'customer.sourceOfIncome' }) })
|
||||
@IsNotEmpty({ message: i18n('validation.IsNotEmpty', { path: 'general', property: 'customer.sourceOfIncome' }) })
|
||||
sourceOfIncome!: string;
|
||||
@IsOptional()
|
||||
sourceOfIncome?: string;
|
||||
|
||||
@ApiProperty({ example: 'Accountant' })
|
||||
@IsString({ message: i18n('validation.IsString', { path: 'general', property: 'customer.profession' }) })
|
||||
@IsNotEmpty({ message: i18n('validation.IsNotEmpty', { path: 'general', property: 'customer.profession' }) })
|
||||
profession!: string;
|
||||
@IsOptional()
|
||||
profession?: string;
|
||||
|
||||
@ApiProperty({ example: 'Finance' })
|
||||
@IsString({ message: i18n('validation.IsString', { path: 'general', property: 'customer.professionType' }) })
|
||||
@IsNotEmpty({ message: i18n('validation.IsNotEmpty', { path: 'general', property: 'customer.professionType' }) })
|
||||
professionType!: string;
|
||||
@IsOptional()
|
||||
professionType?: string;
|
||||
|
||||
@ApiProperty({ example: false })
|
||||
@IsBoolean({ message: i18n('validation.IsBoolean', { path: 'general', property: 'junior.isPep' }) })
|
||||
isPep!: boolean;
|
||||
@IsOptional()
|
||||
isPep?: boolean;
|
||||
|
||||
@ApiProperty({ example: 'bf342-3f3f-3f3f-3f3f' })
|
||||
@IsUUID('4', { message: i18n('validation.IsUUID', { path: 'general', property: 'junior.civilIdFrontId' }) })
|
||||
civilIdFrontId!: string;
|
||||
@IsOptional()
|
||||
civilIdFrontId?: string;
|
||||
|
||||
@ApiProperty({ example: 'bf342-3f3f-3f3f-3f3f' })
|
||||
@IsUUID('4', { message: i18n('validation.IsUUID', { path: 'general', property: 'junior.civilIdBackId' }) })
|
||||
civilIdBackId!: string;
|
||||
@IsOptional()
|
||||
civilIdBackId?: string;
|
||||
}
|
||||
|
Reference in New Issue
Block a user