2023-08-04 17:07:15 -04:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
|
import { Transform } from 'class-transformer';
|
|
|
|
|
import { IsBoolean, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
|
|
|
import { toBoolean, ValidateUUID } from '../../domain.util';
|
|
|
|
|
import { TimeBucketSize } from '../asset.repository';
|
|
|
|
|
|
|
|
|
|
export class TimeBucketDto {
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
|
@IsEnum(TimeBucketSize)
|
|
|
|
|
@ApiProperty({ enum: TimeBucketSize, enumName: 'TimeBucketSize' })
|
|
|
|
|
size!: TimeBucketSize;
|
|
|
|
|
|
|
|
|
|
@ValidateUUID({ optional: true })
|
|
|
|
|
userId?: string;
|
|
|
|
|
|
|
|
|
|
@ValidateUUID({ optional: true })
|
|
|
|
|
albumId?: string;
|
|
|
|
|
|
2023-08-05 09:58:52 -04:00
|
|
|
@ValidateUUID({ optional: true })
|
|
|
|
|
personId?: string;
|
|
|
|
|
|
2023-08-04 17:07:15 -04:00
|
|
|
@IsOptional()
|
|
|
|
|
@IsBoolean()
|
|
|
|
|
@Transform(toBoolean)
|
|
|
|
|
isArchived?: boolean;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsBoolean()
|
|
|
|
|
@Transform(toBoolean)
|
|
|
|
|
isFavorite?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class TimeBucketAssetDto extends TimeBucketDto {
|
|
|
|
|
@IsString()
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
|
timeBucket!: string;
|
|
|
|
|
}
|