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

export const ALLOWED_DOC_TYPES = [
  'FIRE_SAFETY_CERTIFICATE',
  'BUILDING_PLAN',
  'PROPERTY_OWNERSHIP',
  'INSPECTION_REPORT',
  'POLLUTION_CERTIFICATE',
  'ELECTRICAL_SAFETY_CERTIFICATE',
  'STRUCTURAL_STABILITY_CERTIFICATE',
  'IDENTITY_PROOF',
  'ADDRESS_PROOF',
  'OTHER',
];

export class UploadDocumentDto {
  @ApiProperty({
    description: 'Document type',
    enum: ALLOWED_DOC_TYPES,
    example: 'FIRE_SAFETY_CERTIFICATE',
  })
  @IsString()
  @IsIn(ALLOWED_DOC_TYPES)
  docType: string;

  @ApiProperty({
    description: 'Optional description of the document',
    required: false,
    maxLength: 500,
  })
  @IsOptional()
  @IsString()
  @MaxLength(500)
  description?: string;
}
