chore: create,get all announcements with pagination
This commit is contained in:
@@ -7,7 +7,6 @@ export class CreateAnnouncementDto {
|
||||
@IsNotEmpty({ message: AnnouncementMessage.TITLE_IS_REQUIRED })
|
||||
@IsString({ message: AnnouncementMessage.TITLE_STRING })
|
||||
@ApiProperty({
|
||||
type: String,
|
||||
description: "Title of the announcement",
|
||||
example: "اطلاعیه جدید",
|
||||
})
|
||||
@@ -17,25 +16,47 @@ export class CreateAnnouncementDto {
|
||||
@IsString({ message: AnnouncementMessage.CONTENT_IS_STRING })
|
||||
@MinLength(10, { message: AnnouncementMessage.CONTENT_MUST_BE_LONGER })
|
||||
@ApiProperty({
|
||||
type: String,
|
||||
description: "Content of the announcement",
|
||||
example: "اطلاعیه جدید برای کاربران",
|
||||
})
|
||||
content: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: AnnouncementMessage.PUBLISH_AT_IS_REQUIRED })
|
||||
@ApiProperty({
|
||||
description: "Publish date of the announcement",
|
||||
example: "2023-10-01T10:00:00Z",
|
||||
})
|
||||
publishAt: Date;
|
||||
|
||||
@IsBoolean()
|
||||
@ApiProperty({
|
||||
type: Boolean,
|
||||
description: "Is this announcement important?",
|
||||
description: "Is this announcement public?",
|
||||
example: false,
|
||||
})
|
||||
isPublic: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
@ApiProperty({
|
||||
description: "Is this announcement important?",
|
||||
example: false,
|
||||
})
|
||||
isImportant: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: AnnouncementMessage.SERVICE_MUST_BE_ID })
|
||||
@IsUUID("4", { message: AnnouncementMessage.SERVICE_MUST_BE_UUID })
|
||||
@ApiProperty({
|
||||
description: "Service ID",
|
||||
example: "d290f1ee-6c54-4b01-90e6-d701748f0851",
|
||||
})
|
||||
serviceId: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsUUID("4", {
|
||||
each: true,
|
||||
message: "شناسه هر گروه باید یک UUID معتبر نسخه ۴ باشد",
|
||||
message: AnnouncementMessage.GROUP_MUST_BE_UUID,
|
||||
})
|
||||
@ApiProperty({
|
||||
type: [String],
|
||||
|
||||
Reference in New Issue
Block a user