import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';

export class FilterMenuUserPrivilegeConfigurationDto {
  @ApiProperty({ type: ['string'], required: false })
  @Transform((body) => {
    return Array.isArray(body.value) ? body.value : [body.value];
  })
  modules: string[];

  @ApiProperty({ type: ['string'], required: false })
  @Transform((body) => {
    return Array.isArray(body.value) ? body.value : [body.value];
  })
  menus: string[];
}
