import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsInt, IsOptional, IsObject, IsArray, ValidateNested } from 'class-validator';
import { VisitedMenuItemDto } from './visited-menus.dto';
import { Type } from 'class-transformer';

export class RecentVisitedMenusDto {
  @ApiProperty({ example: 1 })
  @IsInt()
  user_id: number;

  @ApiPropertyOptional({ example: 5, nullable: true })
  @IsOptional()
  @IsInt()
  affiliate_user_id?: number | null;

  @ApiPropertyOptional({ type: [VisitedMenuItemDto] })
  @IsOptional()
  @IsArray()
  @ValidateNested({ each: true })
  @Type(() => VisitedMenuItemDto)
  visited_menus?: VisitedMenuItemDto[];
}
