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

/**
 * Proof of delivery captured by the EDR driver when a last-mile leg is
 * completed. Sent as multipart/form-data — the recipient's signature (field
 * `signature`) and proof photos (field `photos`) are uploaded alongside these
 * text fields.
 */
export class RecordProofOfDeliveryDto {
  @ApiProperty({ description: 'Name of the person who received the cargo.' })
  @IsString()
  @IsNotEmpty()
  @MaxLength(160)
  recipientName!: string;

  @ApiPropertyOptional({ description: 'Optional delivery notes.' })
  @IsOptional()
  @IsString()
  @MaxLength(1000)
  notes?: string;
}
