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

24 lines
371 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 {
IsArray, IsNotEmpty,
IsOptional,
IsString
} from 'class-validator';
import { Roles } 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()
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()
password?: string;
}