import { Transform } from 'class-transformer';
import { IsOptional, IsString } from 'class-validator';

export class SendCampaignDto {
  @Transform(({ value }) => {
    if (typeof value !== 'string') return value;
    const trimmed = value.trim();
    return trimmed || undefined;
  })
  @IsOptional()
  @IsString()
  mode?: 'now' | 'scheduled';

  @Transform(({ value }) => {
    if (typeof value !== 'string') return value;
    const trimmed = value.trim();
    return trimmed || undefined;
  })
  @IsOptional()
  @IsString()
  scheduledAt?: string;
}
