import { Field, InputType, Boolean as GraphQLBoolean } from "@nestjs/graphql"; import { IsEmail, IsString, MinLength, IsBoolean, IsOptional, IsIn } from "class-validator"; @InputType() export class RegisterInput { @Field() @IsEmail() email: string; @Field() @IsString() @MinLength(8) password: string; @Field() @IsString() @MinLength(1) firstName: string; @Field() @IsString() @MinLength(1) lastName: string; @Field({ nullable: true, defaultValue: "en" }) @IsOptional() @IsString() @IsIn(["en", "el"]) locale?: string; @Field(() => GraphQLBoolean) @IsBoolean() acceptTerms: boolean; }