import { Expose, Type } from 'class-transformer';
import { IsDateString, IsNumber, IsOptional, IsString, MaxLength, Min } from 'class-validator';
import { DefaultValue } from './decorators/defaultValueDecorator';
import { ValidationClass } from './validationClass';

export class TimestampCursorPaginationVC extends ValidationClass {
    @IsOptional()
    @Expose()
    @IsString()
    @MaxLength(1500)
    @DefaultValue(null)
    cursor!: string | null;

    @IsOptional()
    @Expose()
    @IsNumber()
    @Type(() => Number)
    @Min(1)
    limit?: number;

    @IsOptional()
    @Expose()
    @IsDateString()
    timestamp?: string;
}
