mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
47 lines
1 KiB
TypeScript
47 lines
1 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { Transform } from 'class-transformer';
|
|
import { IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
|
import { Optional, ValidateUUID, toBoolean } from '../../domain.util';
|
|
import { TimeBucketSize } from '../../repositories';
|
|
|
|
export class TimeBucketDto {
|
|
@IsNotEmpty()
|
|
@IsEnum(TimeBucketSize)
|
|
@ApiProperty({ enum: TimeBucketSize, enumName: 'TimeBucketSize' })
|
|
size!: TimeBucketSize;
|
|
|
|
@ValidateUUID({ optional: true })
|
|
userId?: string;
|
|
|
|
@ValidateUUID({ optional: true })
|
|
albumId?: string;
|
|
|
|
@ValidateUUID({ optional: true })
|
|
personId?: string;
|
|
|
|
@Optional()
|
|
@IsBoolean()
|
|
@Transform(toBoolean)
|
|
isArchived?: boolean;
|
|
|
|
@Optional()
|
|
@IsBoolean()
|
|
@Transform(toBoolean)
|
|
isFavorite?: boolean;
|
|
|
|
@Optional()
|
|
@IsBoolean()
|
|
@Transform(toBoolean)
|
|
isTrashed?: boolean;
|
|
|
|
@Optional()
|
|
@IsBoolean()
|
|
@Transform(toBoolean)
|
|
withStacked?: boolean;
|
|
}
|
|
|
|
export class TimeBucketAssetDto extends TimeBucketDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
timeBucket!: string;
|
|
}
|