import { Transform } from 'class-transformer';
import { IsOptional, IsStrongPassword, Matches } from 'class-validator';

export class CreateAppUserDto {
  @IsOptional()
  @Transform(({ value }) => value.trim().replace(/\s+/g, ' '))
  name: string;

  @IsOptional()
  @Transform(({ value }) => value.trim().replace(/\s+/g, ' '))
  @IsStrongPassword(
    {
      minLength: 8,
      minLowercase: 1,
      minNumbers: 1,
      minSymbols: 1,
      minUppercase: 1,
    },
    { message: `Wachtwoord is niet sterk genoeg.` },
  )
  password: string;

  @IsOptional()
  @Transform(({ value }) => value.trim().replace(/\s+/g, ' '))
  email: string;

  @IsOptional()
  zipcode: string;

  profile_picture: string;
  step_goal: string;
  social_id: string;
  social_type: string;
  device_id: string;
  is_email_verified: boolean;
  verification_token: string;
  verification_token_expiry: string;
  access_token: string;
  access_token_expiry: string;
  province_id: string;
  fcm_token: string;
  whatsapp_no: string;
}
