-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nv 2405 workflows crud controller #3745
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5a3e502
feat: added new workflows controller
BiswaViraj 9c47c77
feat: renamed the usecases/commands
BiswaViraj baf45cc
refactor: updated test cases for the workflow controller
BiswaViraj fb0465f
fix: tests
BiswaViraj 5a885e1
fix: tests
BiswaViraj 24c841a
refactor: marked the old notification-temlates controller, usecases a…
BiswaViraj 77bfab7
refactor: update swagger docs for notification templates
BiswaViraj 825daff
refactor: rename dtos to workflow, and other minor changes
BiswaViraj e9bdec2
fix: typo
BiswaViraj d0a2b57
fix: rename file
BiswaViraj 08efdc7
fix: rename file
BiswaViraj 74cea26
Merge pull request #3761 from novuhq/nv-2556-small-refactors-after-pr
BiswaViraj 5f3a309
Merge branch 'next' into nv-2405-workflows-crud-controller
BiswaViraj File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
5 changes: 5 additions & 0 deletions
5
...-template/usecases/change-template-active-status/change-template-active-status.command.ts
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
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
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
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
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
5 changes: 5 additions & 0 deletions
5
...fication-template/usecases/get-notification-template/get-notification-template.command.ts
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
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
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
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
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
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
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
9 changes: 9 additions & 0 deletions
9
apps/api/src/app/workflows/dto/change-workflow-status-request.dto.ts
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsBoolean, IsDefined } from 'class-validator'; | ||
|
||
export class ChangeWorkflowStatusRequestDto { | ||
@ApiProperty() | ||
@IsDefined() | ||
@IsBoolean() | ||
active: boolean; | ||
} |
65 changes: 65 additions & 0 deletions
65
apps/api/src/app/workflows/dto/create-workflow-request.dto.ts
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { IsArray, IsBoolean, IsDefined, IsOptional, IsString, MaxLength, ValidateNested } from 'class-validator'; | ||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { ICreateNotificationTemplateDto, IPreferenceChannels } from '@novu/shared'; | ||
|
||
import { PreferenceChannels } from '../../shared/dtos/preference-channels'; | ||
import { NotificationStep } from '../../shared/dtos/notification-step'; | ||
|
||
export class CreateWorkflowRequestDto implements ICreateNotificationTemplateDto { | ||
@ApiProperty() | ||
@IsString() | ||
@IsDefined() | ||
name: string; | ||
|
||
@ApiProperty() | ||
@IsString() | ||
@IsDefined({ | ||
message: 'Notification group must be provided ', | ||
}) | ||
notificationGroupId: string; | ||
|
||
@ApiPropertyOptional() | ||
@IsOptional() | ||
@IsArray() | ||
tags: string[]; | ||
|
||
@ApiPropertyOptional() | ||
@IsString() | ||
@IsOptional() | ||
@MaxLength(100) | ||
description: string; | ||
|
||
@ApiProperty({ | ||
type: [NotificationStep], | ||
}) | ||
@IsDefined() | ||
@IsArray() | ||
@ValidateNested() | ||
steps: NotificationStep[]; | ||
|
||
@ApiPropertyOptional() | ||
@IsBoolean() | ||
@IsOptional() | ||
active?: boolean; | ||
|
||
@ApiPropertyOptional() | ||
@IsBoolean() | ||
@IsOptional() | ||
draft?: boolean; | ||
|
||
@ApiPropertyOptional() | ||
@IsBoolean() | ||
@IsOptional() | ||
critical?: boolean; | ||
|
||
@ApiPropertyOptional({ | ||
type: PreferenceChannels, | ||
}) | ||
@IsOptional() | ||
preferenceSettings?: IPreferenceChannels; | ||
|
||
@ApiPropertyOptional() | ||
@IsOptional() | ||
@IsString() | ||
blueprintId?: string; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './change-workflow-status-request.dto'; | ||
export * from './create-workflow-request.dto'; | ||
export * from './update-workflow-request.dto'; |
50 changes: 50 additions & 0 deletions
50
apps/api/src/app/workflows/dto/update-workflow-request.dto.ts
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { IsArray, IsMongoId, IsOptional, IsString, MaxLength, ValidateNested } from 'class-validator'; | ||
import { ICreateNotificationTemplateDto, IPreferenceChannels } from '@novu/shared'; | ||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { PreferenceChannels } from '../../shared/dtos/preference-channels'; | ||
import { NotificationStep } from '../../shared/dtos/notification-step'; | ||
|
||
export class UpdateWorkflowRequestDto implements ICreateNotificationTemplateDto { | ||
@ApiProperty() | ||
@IsString() | ||
@IsOptional() | ||
name: string; | ||
|
||
@ApiPropertyOptional() | ||
@IsArray() | ||
@IsOptional() | ||
tags: string[]; | ||
|
||
@ApiPropertyOptional() | ||
@IsString() | ||
@IsOptional() | ||
@MaxLength(300) | ||
description: string; | ||
|
||
@ApiPropertyOptional() | ||
@IsString() | ||
@IsOptional() | ||
identifier?: string; | ||
|
||
@ApiPropertyOptional() | ||
@IsArray() | ||
@IsOptional() | ||
@ValidateNested() | ||
steps: NotificationStep[]; | ||
|
||
@ApiProperty() | ||
@IsOptional() | ||
@IsMongoId() | ||
notificationGroupId: string; | ||
|
||
@ApiPropertyOptional() | ||
active?: boolean; | ||
|
||
@ApiPropertyOptional() | ||
critical?: boolean; | ||
|
||
@ApiPropertyOptional({ | ||
type: PreferenceChannels, | ||
}) | ||
preferenceSettings?: IPreferenceChannels; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to still show it in our api docs? Because 'Notification Templates' tag should be added to bootstrap. It currently shows Workflows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can show it for a few releases and then remove it later