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

export const ALLOWED_DOC_TYPES = [
  'FLOOR_PLAN',
  'PHOTOGRAPH',
  'ID_PROOF',
  'ADDRESS_PROOF',
  'NOC',
  'LICENSE_COPY',
  'OTHER',
  'FIRE_SAFETY',
  'HEALTH_CERT',
  'TAX_CLEARANCE',
  'SITE_PLAN',
  'BUILDING_PERMIT',
  'BUSINESS_LICENSE',
];

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;
}
