-
Notifications
You must be signed in to change notification settings - Fork 0
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 #104 from alkem-io/develop
Release: Refactored notifications builders
- Loading branch information
Showing
63 changed files
with
2,214 additions
and
2,429 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
2 changes: 2 additions & 0 deletions
2
...es/application.created.event.payload.d.ts → .../dto/application.created.event.payload.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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { HubPayload } from './hub.payload'; | ||
|
||
export enum CommunityType { | ||
HUB = 'hub', | ||
CHALLENGE = 'challenge', | ||
|
3 changes: 3 additions & 0 deletions
3
...ion.discussion.created.event.payload.d.ts → ...ation.discussion.created.event.payload.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
1 change: 1 addition & 0 deletions
1
...s/communication.update.event.payload.d.ts → ...dto/communication.update.event.payload.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
12 changes: 12 additions & 0 deletions
12
src/common/dto/community.context.review.submitted.payload.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,12 @@ | ||
export type CommunityContextReviewSubmittedPayload = { | ||
userId: string; | ||
challengeId: string; | ||
community: { name: string }; | ||
questions: FeedbackQuestions[]; | ||
}; | ||
|
||
export type FeedbackQuestions = { | ||
name: string; | ||
value: string; | ||
sortOrder: number; | ||
}; |
File renamed without changes.
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,6 @@ | ||
export * from './application.created.event.payload'; | ||
export * from './communication.discussion.created.event.payload'; | ||
export * from './communication.update.event.payload'; | ||
export * from './community.context.review.submitted.payload'; | ||
export * from './user.registration.event.payload'; | ||
export * from './hub.payload'; |
File renamed without changes.
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,3 +1,8 @@ | ||
export enum AlkemioErrorStatus { | ||
NOT_SUPPORTED = 'NOT_SUPPORTED', | ||
TEMPLATE_NOT_PROVIDED = 'TEMPLATE_NOT_PROVIDED', | ||
PAYLOAD_NOT_PROVIDED = 'PAYLOAD_BUILDER_NOT_PROVIDED', | ||
TEMPLATE_BUILDER_NOT_PROVIDED = 'TEMPLATE_BUILDER_NOT_PROVIDED', | ||
ROLES_NOT_PROVIDED = 'ROLES_NOT_PROVIDED', | ||
RULES_SET_NOT_FOUND = 'RULE_SET_NOT_FOUND', | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './not.supported.exception'; | ||
export * from './base.exception'; | ||
export * from './notification-builder'; |
8 changes: 8 additions & 0 deletions
8
src/common/exceptions/notification-builder/event.payload.not.provided.exception.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,8 @@ | ||
import { LogContext, AlkemioErrorStatus } from '@common/enums'; | ||
import { BaseException } from '../base.exception'; | ||
|
||
export class EventPayloadNotProvidedException extends BaseException { | ||
constructor(error: string, context = LogContext.NOTIFICATIONS) { | ||
super(error, context, AlkemioErrorStatus.PAYLOAD_NOT_PROVIDED); | ||
} | ||
} |
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,5 @@ | ||
export * from './template.not.provided.exception'; | ||
export * from './template.builder.fn.not.provided.exception'; | ||
export * from './event.payload.not.provided.exception'; | ||
export * from './roles.not.provided.exception'; | ||
export * from './rule.set.not.found.exception'; |
8 changes: 8 additions & 0 deletions
8
src/common/exceptions/notification-builder/roles.not.provided.exception.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,8 @@ | ||
import { LogContext, AlkemioErrorStatus } from '@common/enums'; | ||
import { BaseException } from '../base.exception'; | ||
|
||
export class RolesNotProvidedException extends BaseException { | ||
constructor(error: string, context = LogContext.NOTIFICATIONS) { | ||
super(error, context, AlkemioErrorStatus.ROLES_NOT_PROVIDED); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/common/exceptions/notification-builder/rule.set.not.found.exception.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,8 @@ | ||
import { LogContext, AlkemioErrorStatus } from '@common/enums'; | ||
import { BaseException } from '../base.exception'; | ||
|
||
export class RuleSetNotFoundException extends BaseException { | ||
constructor(error: string, context = LogContext.NOTIFICATIONS) { | ||
super(error, context, AlkemioErrorStatus.RULES_SET_NOT_FOUND); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/common/exceptions/notification-builder/template.builder.fn.not.provided.exception.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,8 @@ | ||
import { LogContext, AlkemioErrorStatus } from '@common/enums'; | ||
import { BaseException } from '../base.exception'; | ||
|
||
export class TemplateBuilderFnNotProvidedException extends BaseException { | ||
constructor(error: string, context = LogContext.NOTIFICATIONS) { | ||
super(error, context, AlkemioErrorStatus.TEMPLATE_BUILDER_NOT_PROVIDED); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/common/exceptions/notification-builder/template.not.provided.exception.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,8 @@ | ||
import { LogContext, AlkemioErrorStatus } from '@common/enums'; | ||
import { BaseException } from '../base.exception'; | ||
|
||
export class TemplateNotProvidedException extends BaseException { | ||
constructor(error: string, context = LogContext.NOTIFICATIONS) { | ||
super(error, context, AlkemioErrorStatus.TEMPLATE_NOT_PROVIDED); | ||
} | ||
} |
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,3 +1,4 @@ | ||
export * from './notified.users.provider.interface'; | ||
export * from './feature.flag.provider.interface'; | ||
export * from './notification.recipient.template.provider.interface'; | ||
export * from './notification.builder.interface'; |
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,5 @@ | ||
import { NotificationTemplateType } from '@src/types'; | ||
|
||
export interface INotificationBuilder { | ||
build(payload: Record<string, unknown>): Promise<NotificationTemplateType[]>; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { User } from '../models'; | ||
import { CredentialCriteria } from '../models/credential.criteria'; | ||
import { CredentialCriterion } from '../models/credential.criterion'; | ||
import { IFeatureFlagProvider } from './feature.flag.provider.interface'; | ||
|
||
export interface INotifiedUsersProvider extends IFeatureFlagProvider { | ||
getUser(userID: string): Promise<User>; | ||
getUniqueUsersMatchingCredentialCriteria( | ||
credentialCriterias: CredentialCriteria[] | ||
credentialCriteria: CredentialCriterion[] | ||
): Promise<User[]>; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/core/models/credential.criteria.ts → src/core/models/credential.criterion.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { AuthorizationCredential } from '@alkemio/client-lib'; | ||
|
||
export type CredentialCriteria = { | ||
export type CredentialCriterion = { | ||
type: AuthorizationCredential; | ||
resourceID?: 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './user'; | ||
export * from './credential.criteria'; | ||
export * from './credential.criterion'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from './notification-builder'; | ||
export * from './alkemio-client-adapter'; | ||
export * from './alkemio-url-generator'; | ||
export * from './notification-recipients-adapter'; | ||
export * from './template-to-credential-mapper'; |
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,2 @@ | ||
export * from './notification.builder'; | ||
export * from './notification.builder.factory.provider'; |
Oops, something went wrong.