2023-03-30 21:38:55 +02:00
|
|
|
import { AssetType } from '@app/infra/entities';
|
2023-03-03 03:47:08 +01:00
|
|
|
import { Transform } from 'class-transformer';
|
2023-12-08 17:15:46 +01:00
|
|
|
import { IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
2023-09-04 21:45:59 +02:00
|
|
|
import { Optional, toBoolean } from '../../domain.util';
|
2023-03-03 03:47:08 +01:00
|
|
|
|
|
|
|
export class SearchDto {
|
2023-03-18 14:44:42 +01:00
|
|
|
@IsString()
|
|
|
|
@IsNotEmpty()
|
2023-09-01 18:40:00 +02:00
|
|
|
@Optional()
|
2023-03-18 14:44:42 +01:00
|
|
|
q?: string;
|
|
|
|
|
2023-03-03 03:47:08 +01:00
|
|
|
@IsString()
|
|
|
|
@IsNotEmpty()
|
2023-09-01 18:40:00 +02:00
|
|
|
@Optional()
|
2023-03-03 03:47:08 +01:00
|
|
|
query?: string;
|
|
|
|
|
2023-03-18 14:44:42 +01:00
|
|
|
@IsBoolean()
|
2023-09-01 18:40:00 +02:00
|
|
|
@Optional()
|
2023-03-18 14:44:42 +01:00
|
|
|
@Transform(toBoolean)
|
|
|
|
clip?: boolean;
|
|
|
|
|
2023-03-03 03:47:08 +01:00
|
|
|
@IsEnum(AssetType)
|
2023-09-01 18:40:00 +02:00
|
|
|
@Optional()
|
2023-03-03 03:47:08 +01:00
|
|
|
type?: AssetType;
|
|
|
|
|
2023-03-05 21:44:31 +01:00
|
|
|
@IsBoolean()
|
2023-09-01 18:40:00 +02:00
|
|
|
@Optional()
|
2023-03-05 21:44:31 +01:00
|
|
|
@Transform(toBoolean)
|
|
|
|
recent?: boolean;
|
|
|
|
|
|
|
|
@IsBoolean()
|
2023-09-01 18:40:00 +02:00
|
|
|
@Optional()
|
2023-03-05 21:44:31 +01:00
|
|
|
@Transform(toBoolean)
|
|
|
|
motion?: boolean;
|
2023-03-03 03:47:08 +01:00
|
|
|
}
|
2023-10-10 16:34:25 +02:00
|
|
|
|
|
|
|
export class SearchPeopleDto {
|
|
|
|
@IsString()
|
|
|
|
@IsNotEmpty()
|
|
|
|
name!: string;
|
2023-10-24 17:53:49 +02:00
|
|
|
|
|
|
|
@IsBoolean()
|
|
|
|
@Transform(toBoolean)
|
|
|
|
@Optional()
|
|
|
|
withHidden?: boolean;
|
2023-10-10 16:34:25 +02:00
|
|
|
}
|