import { IRegistration } from "@apihub24/authentication"; import { IsEmail, IsNotEmpty, MinLength } from "class-validator"; /** * represents Registration Data */ export class Registration implements IRegistration { /** * the Account Name to register */ @MinLength(3, { message: "Registration accountName must have min. 3 letters", }) accountName: string; /** * the Password to register */ @MinLength(3, { message: "Registration password must have min. 3 letters" }) password: string; /** * the repeated Password */ @MinLength(3, { message: "Registration passwordComparer must have min. 3 letters", }) passwordComparer: string; /** * the E-Mail Address to register */ @IsEmail(undefined, { message: "Registration email must be a valid email address", }) email: string; /** * the Group Ids the Account must be Part */ @IsNotEmpty({ each: true, message: "Registration groupIds can not be undefined or empty", }) groupIds: string[]; }