import {
  IsArray,
  IsEnum,
  IsInt,
  IsMongoId,
  IsOptional,
  IsString,
  Max,
  MaxLength,
  Min,
  MinLength,
} from 'class-validator'

export class UpdateTenantDto {
  @IsOptional() @IsString() @MinLength(2) @MaxLength(120)
  name?: string

  @IsOptional() @IsEnum(['pending', 'active', 'suspended', 'deleted'])
  status?: 'pending' | 'active' | 'suspended' | 'deleted'

  @IsOptional() @IsEnum(['mvp', 'pro', 'enterprise'])
  plan?: 'mvp' | 'pro' | 'enterprise'

  @IsOptional() @IsInt() @Min(0) @Max(10000)
  seats?: number

  @IsOptional() @IsArray() @IsString({ each: true })
  domains?: string[]

  // Attach / move tenant under a partner (or pass null to detach).
  @IsOptional() @IsMongoId()
  partnerId?: string | null
}
