import { IsNotEmpty, IsString, IsOptional, IsMobilePhone, IsEnum } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { ContactScope } from '../interface/interface';

export class CreateContactDto {
  @IsOptional()
  @IsString()
  @ApiPropertyOptional({ example: 'Question about menu', description: 'Contact subject' })
  subject?: string;

  @IsNotEmpty()
  @IsString()
  @ApiProperty({ example: 'I have a question about your menu items', description: 'Contact content/message' })
  content!: string;

  @IsNotEmpty()
  @IsEnum(['application', 'restaurant'])
  @ApiProperty({ description: 'Contact Scope' })
  scope!: ContactScope;

  @IsOptional()
  @IsString()
  @IsMobilePhone('fa-IR')
  @ApiPropertyOptional({ example: '09362532122', description: 'Phone number' })
  phone?: string;
}
