feat: setup the notification module to the api

This commit is contained in:
Nathnael
2026-07-06 06:51:38 +00:00
parent e910e6c5bd
commit 5a10c14ceb
14 changed files with 750 additions and 1 deletions

View File

@@ -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;
}