import { ApiProperty } from '@nestjs/swagger';
import { IsArray, IsBoolean, IsEmail, IsIn } from 'class-validator';
import { RecurringTransactionIntervalEnum } from 'src/recurring-transactions/recurring-transaction-interval.enum';

export class UpsertCashboxExportSubscriptionDTO {
  @ApiProperty({ example: ['vorstand@example.com'] })
  @IsArray()
  @IsEmail({}, { each: true })
  recipients: string[];

  @ApiProperty({ enum: RecurringTransactionIntervalEnum })
  @IsIn(Object.values(RecurringTransactionIntervalEnum))
  interval: RecurringTransactionIntervalEnum;

  @ApiProperty({ example: true })
  @IsBoolean()
  active: boolean;
}
