2022-07-08 21:26:50 -05:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
2022-08-15 19:11:08 -05:00
|
|
|
import { Transform } from 'class-transformer';
|
2022-07-15 21:30:56 +02:00
|
|
|
import { IsNotEmpty, IsEmail } from 'class-validator';
|
2022-05-21 02:23:55 -05:00
|
|
|
|
|
|
|
|
export class CreateUserDto {
|
2022-07-15 21:30:56 +02:00
|
|
|
@IsEmail()
|
2022-08-15 19:11:08 -05:00
|
|
|
@Transform(({ value }) => value?.toLowerCase())
|
2022-07-08 21:26:50 -05:00
|
|
|
@ApiProperty({ example: 'testuser@email.com' })
|
2022-06-25 19:53:06 +02:00
|
|
|
email!: string;
|
2022-05-21 02:23:55 -05:00
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
2022-07-08 21:26:50 -05:00
|
|
|
@ApiProperty({ example: 'password' })
|
2022-06-25 19:53:06 +02:00
|
|
|
password!: string;
|
2022-05-21 02:23:55 -05:00
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
2022-07-08 21:26:50 -05:00
|
|
|
@ApiProperty({ example: 'John' })
|
2022-06-25 19:53:06 +02:00
|
|
|
firstName!: string;
|
2022-05-21 02:23:55 -05:00
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
2022-07-08 21:26:50 -05:00
|
|
|
@ApiProperty({ example: 'Doe' })
|
2022-06-25 19:53:06 +02:00
|
|
|
lastName!: string;
|
2022-05-21 02:23:55 -05:00
|
|
|
}
|
2022-12-23 21:08:50 +01:00
|
|
|
|
|
|
|
|
export class CreateAdminDto {
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
|
isAdmin!: true;
|
|
|
|
|
|
|
|
|
|
@IsEmail()
|
|
|
|
|
@Transform(({ value }) => value?.toLowerCase())
|
|
|
|
|
email!: string;
|
|
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
|
password!: string;
|
|
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
|
firstName!: string;
|
|
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
|
lastName!: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class CreateUserOAuthDto {
|
|
|
|
|
@IsEmail()
|
|
|
|
|
@Transform(({ value }) => value?.toLowerCase())
|
|
|
|
|
email!: string;
|
|
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
|
oauthId!: string;
|
|
|
|
|
|
|
|
|
|
firstName?: string;
|
|
|
|
|
|
|
|
|
|
lastName?: string;
|
|
|
|
|
}
|