import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsIn, IsInt } from 'class-validator';
import { type PromoteFeaturedDuration } from '../../application/commands/promote-featured-listing/promote-featured-listing.command';

const ALLOWED_DURATIONS: readonly number[] = [3, 7, 14, 30];

export class PromoteFeaturedListingDto {
  @ApiProperty({
    enum: ALLOWED_DURATIONS,
    example: 7,
    description: 'Số ngày đẩy nổi bật (dùng quota subscription, không phát sinh thanh toán)',
  })
  @Type(() => Number)
  @IsInt()
  @IsIn([...ALLOWED_DURATIONS])
  durationDays!: PromoteFeaturedDuration;
}
