mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 09:30:59 +00:00
69 lines
1.5 KiB
TypeScript
69 lines
1.5 KiB
TypeScript
import { IsEmail, IsString, ValidateNested } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
export class NameDto {
|
|
@ApiProperty({ example: 'ቀለሙ ቀጸላ' })
|
|
@IsString()
|
|
am: string;
|
|
|
|
@ApiProperty({ example: 'Kelemu Ketsela' })
|
|
@IsString()
|
|
en: string;
|
|
}
|
|
|
|
export class RegisterDto {
|
|
@ApiProperty({ example: 'kelemu@email.com' })
|
|
@IsEmail()
|
|
email: string;
|
|
|
|
@ApiProperty({ example: 'kelemu.ketsela' })
|
|
@IsString()
|
|
username: string;
|
|
|
|
@ApiProperty({ example: '+251912345678' })
|
|
@IsString()
|
|
phoneNumber: string;
|
|
|
|
@ApiProperty({ type: NameDto })
|
|
@ValidateNested()
|
|
@Type(() => NameDto)
|
|
name: NameDto;
|
|
}
|
|
|
|
export class ResendRegistrationCodeDto {
|
|
@ApiProperty({ example: 'kelemu@email.com' })
|
|
@IsEmail()
|
|
email: string;
|
|
|
|
@ApiProperty({ example: '+251912345678' })
|
|
@IsString()
|
|
phoneNumber: string;
|
|
}
|
|
|
|
export class LoginDto {
|
|
@ApiProperty({ example: 'kelemu@email.com' })
|
|
@IsEmail()
|
|
email: string;
|
|
|
|
@ApiProperty({ example: 'password123', format: 'password' })
|
|
@IsString()
|
|
password: string;
|
|
}
|
|
|
|
export class FaydaRequestPasswordSetupDto {
|
|
@ApiProperty({ example: '+251911234567', description: 'Phone number of the Fayda-verified account' })
|
|
@IsString()
|
|
phoneNumber: string;
|
|
}
|
|
|
|
export class FaydaVerifyAndLoginDto {
|
|
@ApiProperty({ example: '+251911234567' })
|
|
@IsString()
|
|
phoneNumber: string;
|
|
|
|
@ApiProperty({ example: '123456', description: '6-digit OTP received via SMS' })
|
|
@IsString()
|
|
otp: string;
|
|
}
|