mirror of
https://github.com/immich-app/immich.git
synced 2026-04-02 08:58:52 -04:00
* refactor: user repository * refactor: user module * refactor: move database into infra * refactor(cli): use user core * chore: import path * chore: tests
54 lines
1002 B
TypeScript
54 lines
1002 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { Transform } from 'class-transformer';
|
|
import { IsNotEmpty, IsEmail } from 'class-validator';
|
|
|
|
export class CreateUserDto {
|
|
@IsEmail()
|
|
@Transform(({ value }) => value?.toLowerCase())
|
|
@ApiProperty({ example: 'testuser@email.com' })
|
|
email!: string;
|
|
|
|
@IsNotEmpty()
|
|
@ApiProperty({ example: 'password' })
|
|
password!: string;
|
|
|
|
@IsNotEmpty()
|
|
@ApiProperty({ example: 'John' })
|
|
firstName!: string;
|
|
|
|
@IsNotEmpty()
|
|
@ApiProperty({ example: 'Doe' })
|
|
lastName!: string;
|
|
}
|
|
|
|
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;
|
|
}
|