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

// Partner self-service tenant edit. Deliberately narrower than the operator
// UpdateTenantDto: no `status` (use suspend/resume), no `plan` or `partnerId`
// (operator-only — a partner must not move a tenant between partners or change
// its plan tier without an operator). Everything here is safe for a partner to
// change on a customer they own.
export class PartnerUpdateTenantDto {
  @IsOptional() @IsString() @MinLength(2) @MaxLength(120)
  name?: string

  @IsOptional() @IsString() @MaxLength(80)
  industry?: string

  @IsOptional()
  @IsString()
  @Matches(/^(#[0-9a-fA-F]{6})?$/, { message: 'brandColor must be a #rrggbb hex or empty' })
  brandColor?: string

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

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