-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from poojakarma/change_Responses_and_DB_tables_…
…names PS-1745 : Tags replacement in subjects for email, push, sms etc notification and Changed response format
- Loading branch information
Showing
2 changed files
with
94 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { IsString, IsEmail, IsArray, ValidateNested, IsObject, IsNotEmpty, ArrayMinSize, IsBoolean, IsOptional } from 'class-validator'; | ||
import { Type } from 'class-transformer'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | ||
|
||
export class EmailDTO { | ||
|
||
|
@@ -49,11 +49,24 @@ export class NotificationDto { | |
@IsString() | ||
key: string; | ||
|
||
@ApiProperty({ example: ['John Doe', 'How to use UI tools'] }) | ||
// @ApiProperty({ example: ['John Doe', 'How to use UI tools'] }) | ||
// @IsOptional() | ||
// @IsArray() | ||
// @ArrayMinSize(1) | ||
// replacements: string[]; | ||
@ApiPropertyOptional({ | ||
description: 'Dynamic replacements for template tags', | ||
example: { | ||
"{eventName}": "How to use UI tools", | ||
"{userName}": "John Doe", | ||
"{courseTitle}": "How to use UI tools", | ||
"{contactEmail}": "[email protected]" | ||
} | ||
}) | ||
@IsOptional() | ||
@IsArray() | ||
@ArrayMinSize(1) | ||
replacements: string[]; | ||
@IsObject() | ||
// @ValidateReplacement() // Custom decorator to ensure at least one replacement | ||
replacements?: { [key: string]: string }; | ||
|
||
@ApiProperty({ type: EmailDTO, description: 'Email notification details' }) | ||
@ValidateNested() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters