scipaper/src/core/domain/dtos/page-meta.dto.ts
2022-09-21 15:14:57 +03:00

33 lines
794 B
TypeScript

import { ApiExtraModels, ApiProperty } from "@nestjs/swagger";
import { IsArray } from "class-validator";
import { Order } from "../enums";
/**
* List of allowed properties in this DTO
*/
const allowedProperties = ['total', 'pagenum', 'order', 'hasNext', 'hasPrev', 'pagesize'];
/**
* Page model for pagination
*/
@ApiExtraModels()
export class PageMetaDto {
/**
* Total number of hits (results) acquired from the search
*/
@IsArray()
@ApiProperty({
description: 'Total number of hits (results) acquired from the search',
example: 314
})
total: number;
/**
* Order of the elements on the page
*/
@ApiProperty({
description: 'Order of the elements on the page',
example: Order.DESC
})
order: Order;
}