import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsIn, IsObject, IsOptional, IsString } from 'class-validator';
import { ESTATE_ID_EXAMPLE } from '../../common/swagger-docs';

export class SendNotificationDto {
  @ApiProperty({ example: ESTATE_ID_EXAMPLE, description: 'Estate context for the notification request.' })
  @IsString()
  estateId!: string;

  @ApiProperty({ enum: ['WHATSAPP', 'SMS', 'PUSH'], example: 'SMS', description: 'Notification channel.' })
  @IsIn(['WHATSAPP', 'SMS', 'PUSH'])
  channel!: 'WHATSAPP' | 'SMS' | 'PUSH';

  @ApiProperty({ example: '+2348111111111', description: 'Recipient address for the selected channel.' })
  @IsString()
  recipient!: string;

  @ApiProperty({ example: 'Your visitor pass is ready', description: 'Message body.' })
  @IsString()
  message!: string;

  @ApiPropertyOptional({ example: { visitorPassId: 'visitor-pass-uuid' }, description: 'Additional notification context.' })
  @IsOptional()
  @IsObject()
  metadata?: Record<string, unknown>;
}
