import { IsString, IsOptional, IsBoolean, IsEmail, IsObject, MaxLength, IsDateString } from 'class-validator';

export class CreatePersonDto {
  @IsString()
  @MaxLength(200)
  fullName: string;

  @IsOptional()
  @IsString()
  @MaxLength(100)
  firstName?: string;

  @IsOptional()
  @IsString()
  @MaxLength(100)
  lastName?: string;

  @IsOptional()
  @IsString()
  @MaxLength(100)
  maternalName?: string;

  @IsEmail()
  email: string;

  @IsOptional()
  @IsString()
  @MaxLength(20)
  phone?: string;

  @IsOptional()
  @IsString()
  @MaxLength(20)
  mobilePhone?: string;

  @IsOptional()
  @IsString()
  @MaxLength(50)
  identificationType?: string;

  @IsOptional()
  @IsString()
  @MaxLength(50)
  identificationNumber?: string;

  @IsOptional()
  @IsDateString()
  identificationExpiry?: string;

  @IsOptional()
  @IsObject()
  address?: {
    street?: string;
    number?: string;
    interior?: string;
    neighborhood?: string;
    city?: string;
    state?: string;
    postalCode?: string;
    country?: string;
  };

  @IsOptional()
  @IsBoolean()
  isResponsibleForTenant?: boolean;
}

export class UpdatePersonDto {
  @IsOptional()
  @IsString()
  @MaxLength(200)
  fullName?: string;

  @IsOptional()
  @IsString()
  @MaxLength(100)
  firstName?: string;

  @IsOptional()
  @IsString()
  @MaxLength(100)
  lastName?: string;

  @IsOptional()
  @IsString()
  @MaxLength(100)
  maternalName?: string;

  @IsOptional()
  @IsEmail()
  email?: string;

  @IsOptional()
  @IsString()
  @MaxLength(20)
  phone?: string;

  @IsOptional()
  @IsString()
  @MaxLength(20)
  mobilePhone?: string;

  @IsOptional()
  @IsString()
  @MaxLength(50)
  identificationType?: string;

  @IsOptional()
  @IsString()
  @MaxLength(50)
  identificationNumber?: string;

  @IsOptional()
  @IsDateString()
  identificationExpiry?: string;

  @IsOptional()
  @IsObject()
  address?: {
    street?: string;
    number?: string;
    interior?: string;
    neighborhood?: string;
    city?: string;
    state?: string;
    postalCode?: string;
    country?: string;
  };
}

export class VerifyPersonDto {
  @IsOptional()
  @IsString()
  verifiedBy?: string;
}
