import { ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsInt, IsOptional } from 'class-validator';

/**
 * `GET /v1/zoom/general-links/user/:userId` query — `userId` comes from the path. `programId`/
 * `sessionId` are both optional and independent (unlike `ListZoomGeneralLinksV1Dto`'s
 * programId-XOR-sessionId): this endpoint's default is "every program/session for this user", so
 * either or both may be passed to narrow that down further rather than being required to pick one.
 * No pagination — a user only ever holds one active ROLE row per session (see the table's own
 * partial unique index), so even the unscoped result set stays small.
 */
export class ListZoomGeneralLinksByUserV1Dto {
  @ApiPropertyOptional({ description: 'Narrows to generated links within this program only.' })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  programId?: number;

  @ApiPropertyOptional({ description: 'Narrows to generated links for this one session only.' })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  sessionId?: number;
}
