2023-08-04 17:07:15 -04:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
2024-03-07 22:59:02 -05:00
|
|
|
import { IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
2024-03-20 16:02:51 -05:00
|
|
|
import { AssetOrder } from 'src/entities/album.entity';
|
2024-03-20 21:42:58 +01:00
|
|
|
import { TimeBucketSize } from 'src/interfaces/asset.repository';
|
2024-03-20 15:04:03 -05:00
|
|
|
import { Optional, ValidateBoolean, ValidateUUID } from 'src/validation';
|
2023-08-04 17:07:15 -04:00
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean({ optional: true })
|
2023-08-04 17:07:15 -04:00
|
|
|
isArchived?: boolean;
|
|
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean({ optional: true })
|
2023-08-04 17:07:15 -04:00
|
|
|
isFavorite?: boolean;
|
2023-10-06 07:01:14 +00:00
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean({ optional: true })
|
2023-10-06 07:01:14 +00:00
|
|
|
isTrashed?: boolean;
|
2023-10-27 15:34:01 -05:00
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean({ optional: true })
|
2023-10-27 15:34:01 -05:00
|
|
|
withStacked?: boolean;
|
2023-11-11 15:06:19 -06:00
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean({ optional: true })
|
2023-11-11 15:06:19 -06:00
|
|
|
withPartners?: boolean;
|
2024-03-14 17:45:03 +01:00
|
|
|
|
|
|
|
|
@IsEnum(AssetOrder)
|
|
|
|
|
@Optional()
|
|
|
|
|
@ApiProperty({ enum: AssetOrder, enumName: 'AssetOrder' })
|
|
|
|
|
order?: AssetOrder;
|
2023-08-04 17:07:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class TimeBucketAssetDto extends TimeBucketDto {
|
|
|
|
|
@IsString()
|
|
|
|
|
timeBucket!: string;
|
|
|
|
|
}
|
2024-03-20 23:53:07 +01:00
|
|
|
|
|
|
|
|
export class TimeBucketResponseDto {
|
|
|
|
|
@ApiProperty({ type: 'string' })
|
|
|
|
|
timeBucket!: string;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
|
count!: number;
|
|
|
|
|
}
|