import { IsIn, IsOptional, IsString, Matches, ValidateIf } from 'class-validator'; import { ASSIGNABLE_TEAM_ROLES } from '../../auth/auth.types'; export class AssignTeamAccessDto { @IsString() @Matches(/^\d+$/) userId!: string; @IsString() @IsIn(['customer', 'staff']) access!: 'customer' | 'staff'; @ValidateIf((dto: AssignTeamAccessDto) => dto.access === 'staff') @IsString() @IsIn([...ASSIGNABLE_TEAM_ROLES]) roleSlug?: string; }