Files
Picsur/shared/src/entities/user.entity.ts

27 lines
417 B
TypeScript
Raw Normal View History

2022-03-03 13:38:39 +01:00
import { Exclude } from 'class-transformer';
2022-03-12 15:10:22 +01:00
import {
2022-03-12 16:25:15 +01:00
IsArray, IsInt, IsNotEmpty,
2022-03-12 15:10:22 +01:00
IsOptional,
IsString
} from 'class-validator';
import { Roles } from '../dto/roles.dto';
export class EUser {
2022-02-26 18:16:28 +01:00
@IsOptional()
2022-03-12 16:25:15 +01:00
@IsInt()
2022-02-26 18:16:28 +01:00
id?: number;
@IsNotEmpty()
2022-03-12 16:25:15 +01:00
@IsString()
username: string;
2022-03-10 23:02:27 +01:00
@IsArray()
2022-03-12 15:10:22 +01:00
@IsString({ each: true })
2022-03-10 23:02:27 +01:00
roles: Roles;
@IsOptional()
2022-02-26 18:16:28 +01:00
@Exclude()
2022-03-12 16:25:15 +01:00
@IsString()
password?: string;
}