mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
* feat: add personId to time bucket endpoints * chore: open api * feat(web): time bucket on person detail page
37 lines
907 B
TypeScript
37 lines
907 B
TypeScript
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;
|
|
|
|
@ValidateUUID({ optional: true })
|
|
personId?: string;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
@Transform(toBoolean)
|
|
isArchived?: boolean;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
@Transform(toBoolean)
|
|
isFavorite?: boolean;
|
|
}
|
|
|
|
export class TimeBucketAssetDto extends TimeBucketDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
timeBucket!: string;
|
|
}
|