import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsBoolean, IsOptional, IsString, MaxLength } from 'class-validator';

export class CreateShippingLineDto {
  @ApiProperty({ description: 'Unique shipping line code, e.g. MSC, PIL, MAERSK', maxLength: 20 })
  @IsString()
  @MaxLength(20)
  code!: string;

  @ApiProperty({ description: 'Customer-facing label', maxLength: 100 })
  @IsString()
  @MaxLength(100)
  label!: string;

  @ApiPropertyOptional({
    description: 'If set, backend silently uses this code for pricing tier lookups (e.g. PIL → MAERSK)',
    maxLength: 20,
  })
  @IsOptional()
  @IsString()
  @MaxLength(20)
  mappedToCode?: string;

  @ApiPropertyOptional({
    default: false,
    description: 'If true, quotation renders additional fee notice to customer',
  })
  @IsOptional()
  @IsBoolean()
  showExtraFeeNotice?: boolean;

  @ApiPropertyOptional({ default: true })
  @IsOptional()
  @IsBoolean()
  isActive?: boolean;
}
