import { ApiProperty } from '@nestjs/swagger';
import { IsIn, IsNotEmpty, IsOptional } from 'class-validator';
import { PromotionPlanTypes } from '../entities/promotion-plan.entity';
import { AvailableSection } from '../../discount/entities/discount.entity';

export class UpdatePromotionPlanDto {
  @ApiProperty({ example: '' })
  @IsNotEmpty()
  id: number;

  @ApiProperty({ example: '' })
  @IsOptional()
  name: string;

  @ApiProperty({ example: '' })
  @IsOptional()
  customerId: number;

  @ApiProperty({ example: '' })
  @IsOptional()
  discountPercentage: number;

  @ApiProperty({ example: '' })
  @IsOptional()
  discountAmount: number;

  @ApiProperty({ example: '' })
  @IsOptional()
  validityDays: number;

  @ApiProperty({ example: '' })
  @IsOptional()
  startDate: string | null;

  @ApiProperty({ example: '' })
  @IsOptional()
  endDate: string | null;

  @ApiProperty({ enum: PromotionPlanTypes })
  @IsOptional()
  @IsIn(Object.values(PromotionPlanTypes))
  type: PromotionPlanTypes;

  @ApiProperty({ enum: AvailableSection })
  @IsOptional()
  @IsIn(Object.values(AvailableSection))
  section: AvailableSection;
}
