29 lines
407 B
TypeScript
29 lines
407 B
TypeScript
import { Group } from './group';
|
|
import {
|
|
IsEmail,
|
|
IsNotEmpty,
|
|
MinLength,
|
|
ValidateNested,
|
|
} from 'class-validator';
|
|
|
|
export class Account {
|
|
id: string;
|
|
|
|
@MinLength(3)
|
|
accountName: string;
|
|
|
|
@MinLength(3)
|
|
passwordHash: string;
|
|
|
|
@IsEmail()
|
|
email: string;
|
|
|
|
emailVerified: boolean;
|
|
|
|
active: boolean;
|
|
|
|
@IsNotEmpty({ each: true })
|
|
@ValidateNested({ each: true })
|
|
groups: Group[];
|
|
}
|