import { ApiProperty } from '@nestjs/swagger';
import { GetReportDataDto } from './report-data.get.dto';
import { IsString, IsNumber, IsOptional, IsArray } from 'class-validator';
import { ColumnStateEntity } from '../entities/query-model.entity';

export class CreateReportExportDto extends GetReportDataDto {
  @ApiProperty({ name: 'time_zone', required: true, default: 'Asia/Jakarta' })
  @IsString()
  time_zone: string;

  @ApiProperty({ name: 'file_name', required: false })
  @IsString()
  @IsOptional()
  file_name?: string;

  @ApiProperty({
    name: 'column_state',
    type: [Object],
    required: true,
    default: [
      { colId: 'main__created_at' },
      { colId: 'main__updated_at' },
      { colId: 'main__name' },
    ],
  })
  @IsOptional()
  @IsArray()
  column_state: ColumnStateEntity[];
}
