first commit

This commit is contained in:
Bastian Wagner
2026-07-31 21:02:47 +02:00
commit 6bea4f766a
512 changed files with 64459 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
import { Transform } from 'class-transformer';
import { ApiProperty } from '@nestjs/swagger';
import { Role } from '../../roles/entities/role.entity';
import {
IsEmail,
IsNotEmpty,
IsOptional,
MinLength,
Validate,
} from 'class-validator';
import { Status } from '../../statuses/entities/status.entity';
import { IsNotExist } from '../../utils/validators/is-not-exists.validator';
import { FileEntity } from '../../files/entities/file.entity';
import { IsExist } from '../../utils/validators/is-exists.validator';
export class CreateUserDto {
@ApiProperty({ example: 'test1@example.com' })
@Transform(({ value }) => value?.toLowerCase().trim())
@IsNotEmpty()
@Validate(IsNotExist, ['User'], {
message: 'emailAlreadyExists',
})
@IsEmail()
email: string | null;
@ApiProperty()
@MinLength(6)
password?: string;
provider?: string;
socialId?: string | null;
@ApiProperty({ example: 'John' })
@IsNotEmpty()
firstName: string | null;
@ApiProperty({ example: 'Doe' })
@IsNotEmpty()
lastName: string | null;
@ApiProperty({ type: () => FileEntity })
@IsOptional()
@Validate(IsExist, ['FileEntity', 'id'], {
message: 'imageNotExists',
})
photo?: FileEntity | null;
@ApiProperty({ type: Role })
@Validate(IsExist, ['Role', 'id'], {
message: 'roleNotExists',
})
role?: Role | null;
@ApiProperty({ type: Status })
@Validate(IsExist, ['Status', 'id'], {
message: 'statusNotExists',
})
status?: Status;
hash?: string | null;
linkPlayerId?: number | null;
}

View File

@@ -0,0 +1,62 @@
import { PartialType } from '@nestjs/swagger';
import { CreateUserDto } from './create-user.dto';
import { Transform } from 'class-transformer';
import { ApiProperty } from '@nestjs/swagger';
import { Role } from '../../roles/entities/role.entity';
import { IsEmail, IsOptional, MinLength, Validate } from 'class-validator';
import { Status } from '../../statuses/entities/status.entity';
import { IsNotExist } from '../../utils/validators/is-not-exists.validator';
import { FileEntity } from '../../files/entities/file.entity';
import { IsExist } from '../../utils/validators/is-exists.validator';
export class UpdateUserDto extends PartialType(CreateUserDto) {
@ApiProperty({ example: 'test1@example.com' })
@Transform(({ value }) => value?.toLowerCase().trim())
@IsOptional()
@Validate(IsNotExist, ['User'], {
message: 'emailAlreadyExists',
})
@IsEmail()
email?: string | null;
@ApiProperty()
@IsOptional()
@MinLength(6)
password?: string;
provider?: string;
socialId?: string | null;
@ApiProperty({ example: 'John' })
@IsOptional()
firstName?: string | null;
@ApiProperty({ example: 'Doe' })
@IsOptional()
lastName?: string | null;
@ApiProperty({ type: () => FileEntity })
@IsOptional()
@Validate(IsExist, ['FileEntity', 'id'], {
message: 'imageNotExists',
})
photo?: FileEntity | null;
@ApiProperty({ type: Role })
@IsOptional()
@Validate(IsExist, ['Role', 'id'], {
message: 'roleNotExists',
})
role?: Role | null;
@ApiProperty({ type: Status })
@IsOptional()
@Validate(IsExist, ['Status', 'id'], {
message: 'statusNotExists',
})
status?: Status;
hash?: string | null;
}