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

20 lines
383 B
TypeScript
Raw Normal View History

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