forked from Cutlery/immich
* feat: album orders * fix: tests * pr feedback * pr feedback * pr feedback * fix: tests * add comment * pr feedback * fix: rendering issue * wording * fix: order value doesn't change --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import { AssetOrder } from '@app/infra/entities';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
|
import { Optional, ValidateBoolean, ValidateUUID } 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;
|
|
|
|
@ValidateBoolean({ optional: true })
|
|
isArchived?: boolean;
|
|
|
|
@ValidateBoolean({ optional: true })
|
|
isFavorite?: boolean;
|
|
|
|
@ValidateBoolean({ optional: true })
|
|
isTrashed?: boolean;
|
|
|
|
@ValidateBoolean({ optional: true })
|
|
withStacked?: boolean;
|
|
|
|
@ValidateBoolean({ optional: true })
|
|
withPartners?: boolean;
|
|
|
|
@IsEnum(AssetOrder)
|
|
@Optional()
|
|
@ApiProperty({ enum: AssetOrder, enumName: 'AssetOrder' })
|
|
order?: AssetOrder;
|
|
}
|
|
|
|
export class TimeBucketAssetDto extends TimeBucketDto {
|
|
@IsString()
|
|
timeBucket!: string;
|
|
}
|