import { IsIn, IsNotEmpty, IsOptional, ValidateNested } from 'class-validator' import { Type } from 'class-transformer' import { APPOINTMENT_TYPES, AppointmentType } from '../../domain' import { countryByCode, CountryCode } from '../../../../utils/countries' import { AuthBaseParams } from '../../../../params' export class AppointmentsReportInput { @IsNotEmpty() readonly begin_date: string @IsNotEmpty() readonly end_date: string @IsOptional() readonly nutritionist_id: string @IsOptional() @IsIn(Object.keys(countryByCode)) readonly country_code: CountryCode @IsOptional() @IsIn([...APPOINTMENT_TYPES]) readonly appointment_type: AppointmentType } export class AppointmentsReportParams extends AuthBaseParams { @IsNotEmpty() @ValidateNested() @Type(() => AppointmentsReportInput) readonly input: AppointmentsReportInput }