mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-17 12:43:13 +02:00
27 lines
478 B
TypeScript
27 lines
478 B
TypeScript
|
|
import { Expose, plainToClass } from "class-transformer";
|
||
|
|
import { IsEmail, IsNotEmpty, IsString } from "class-validator";
|
||
|
|
|
||
|
|
export class AuthDTO {
|
||
|
|
@Expose()
|
||
|
|
id: string;
|
||
|
|
|
||
|
|
@Expose()
|
||
|
|
firstName: string;
|
||
|
|
|
||
|
|
@Expose()
|
||
|
|
lastName: string;
|
||
|
|
|
||
|
|
@Expose()
|
||
|
|
@IsNotEmpty()
|
||
|
|
@IsEmail()
|
||
|
|
email: string;
|
||
|
|
|
||
|
|
@IsNotEmpty()
|
||
|
|
@IsString()
|
||
|
|
password: string;
|
||
|
|
|
||
|
|
constructor(partial: Partial<AuthDTO>) {
|
||
|
|
return plainToClass(AuthDTO, partial, { excludeExtraneousValues: true });
|
||
|
|
}
|
||
|
|
}
|