import { IsString, IsOptional, IsEmail, MaxLength, Length, Matches, IsEnum } from 'class-validator';
import { CompanyNationality } from '../entities/company.entity';
import { IsValidPhone } from '../../../common/validators/is-phone-number.validator';

export class UpdateProfileDto {
  @IsOptional()
  @IsEnum(CompanyNationality)
  nationality?: CompanyNationality;

  @IsOptional()
  @IsString()
  @MaxLength(200)
  companyName?: string;

  @IsOptional()
  @IsEmail()
  @MaxLength(150)
  companyEmail?: string;

  @IsOptional()
  @IsString()
  @MaxLength(20)
  @IsValidPhone()
  companyPhone?: string;

  @IsOptional()
  @IsString()
  @MaxLength(32)
  companyLocation?: string;

  @IsOptional()
  @IsString()
  companyAddress?: string;

  @IsOptional()
  @IsString()
  @Length(10, 10)
  @Matches(/^00\d{8}$/, {
    message: 'TIN must be 10 digits starting with 00',
  })
  tin?: string;

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

  @IsOptional()
  @IsString()
  @MaxLength(16)
  fanNumber?: string;

  @IsOptional()
  @IsString()
  contactPersonName?: string;

  @IsOptional()
  @IsString()
  contactPersonPosition?: string;

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

  @IsOptional()
  @IsString()
  @IsValidPhone()
  contactPersonPhone?: string;

  @IsOptional()
  @IsString()
  generalManagerName?: string;

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

  @IsOptional()
  @IsString()
  @IsValidPhone()
  generalManagerPhone?: string;

  @IsOptional()
  @IsString()
  poaName?: string;

  @IsOptional()
  @IsString()
  @IsValidPhone()
  poaPhone?: string;

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

  @IsOptional()
  @IsString()
  poaLocation?: string;

  @IsOptional()
  @IsString()
  poaAddress?: string;

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

  @IsOptional()
  @IsString()
  statusDescription?: string;

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

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

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

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

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

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

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

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

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

  @IsOptional()
  @IsString()
  @MaxLength(20)
  @IsValidPhone()
  etradePhone?: string;
}
