mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 01:48:12 +00:00
feat: setup the notification module to the api
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { Transform, Type } from "class-transformer";
|
||||
import { IsBoolean, IsInt, IsOptional, Max, Min } from "class-validator";
|
||||
|
||||
export class ListNotificationsQueryDto {
|
||||
@ApiPropertyOptional({
|
||||
description: "Filter by read state. Omit to return all.",
|
||||
})
|
||||
@IsOptional()
|
||||
@Transform(({ value }) =>
|
||||
value === "true" ? true : value === "false" ? false : value,
|
||||
)
|
||||
@IsBoolean()
|
||||
isRead?: boolean;
|
||||
|
||||
@ApiPropertyOptional({ minimum: 1, default: 1 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
page?: number;
|
||||
|
||||
@ApiPropertyOptional({ minimum: 1, maximum: 100, default: 20 })
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(100)
|
||||
limit?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user