import {
  IsNotEmpty,
  IsOptional,
  IsString,
  IsUUID,
  IsNumber,
  IsIn,
  MaxLength,
} from 'class-validator';

export class CreateTransportPricingDto {
  @IsUUID()
  @IsNotEmpty()
  destination_id: string;

  @IsUUID()
  @IsNotEmpty()
  transport_service_id: string;

  @IsString()
  @IsNotEmpty()
  @MaxLength(50)
  category: string;

  /**
   * Vehicle type — required for PVT (FK into vehicle_types), NULL or
   * omitted for SIC. SIC rates are per-person on the shared coach,
   * no vehicle axis.
   */
  @IsUUID()
  @IsOptional()
  vehicle_type_id?: string | null;

  /**
   * Sale mode — defaults to PVT when omitted to preserve the
   * pre-mode contract for callers that haven't been updated yet.
   */
  @IsIn(['PVT', 'SIC'])
  @IsOptional()
  mode?: 'PVT' | 'SIC';

  @IsUUID()
  @IsNotEmpty()
  currency_id: string;

  @IsNumber()
  @IsOptional()
  default_price?: number;

  @IsNumber()
  @IsOptional()
  season_1_price?: number;

  @IsNumber()
  @IsOptional()
  season_2_price?: number;

  @IsNumber()
  @IsOptional()
  season_3_price?: number;

  @IsNumber()
  @IsOptional()
  season_4_price?: number;

  @IsNumber()
  @IsOptional()
  season_5_price?: number;

  // Floor prices — lowest acceptable selling price per season. Null
  // means "no floor for this season". Same column count as selling.

  @IsNumber()
  @IsOptional()
  floor_default_price?: number;

  @IsNumber()
  @IsOptional()
  floor_season_1_price?: number;

  @IsNumber()
  @IsOptional()
  floor_season_2_price?: number;

  @IsNumber()
  @IsOptional()
  floor_season_3_price?: number;

  @IsNumber()
  @IsOptional()
  floor_season_4_price?: number;

  @IsNumber()
  @IsOptional()
  floor_season_5_price?: number;
}

export class BulkTransportPricingDto {
  items: CreateTransportPricingDto[];
}
