fix(SPG-1049): add order to queue item
parent
83d53847d7
commit
b4bc31463e
|
@ -1,7 +1,8 @@
|
|||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsBoolean, ValidateIf } from 'class-validator';
|
||||
import { IsBoolean, IsEnum, ValidateIf } from 'class-validator';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { FilterQueueEntity } from 'src/modules/queue/domain/entities/filter.entity';
|
||||
import { ORDER_TYPE } from 'src/core/strings/constants/base.constants';
|
||||
|
||||
export class QueueDto implements FilterQueueEntity {
|
||||
@ApiProperty({
|
||||
|
@ -21,4 +22,20 @@ export class QueueDto implements FilterQueueEntity {
|
|||
@IsBoolean()
|
||||
@ValidateIf((body) => body.vip)
|
||||
vip: boolean;
|
||||
|
||||
@ApiProperty({ type: String, required: false })
|
||||
order_by: string;
|
||||
|
||||
@ApiProperty({
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: `Select ("${ORDER_TYPE.ASC}", "${ORDER_TYPE.DESC}")`,
|
||||
})
|
||||
@ValidateIf((body) => body.order_type)
|
||||
@IsEnum(ORDER_TYPE, {
|
||||
message: `order_type must be a valid enum ${JSON.stringify(
|
||||
Object.values(ORDER_TYPE),
|
||||
)}`,
|
||||
})
|
||||
order_type: ORDER_TYPE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue