Skip to content

Commit

Permalink
add superfluid tokens email
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Mar 6, 2024
1 parent cb6dc6d commit deb60b8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/services/notificationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ const activityCreator = (payload: any, orttoEventName: NOTIFICATIONS_EVENT_NAMES
}
let attributes;
switch (orttoEventName) {
case NOTIFICATIONS_EVENT_NAMES.USER_SUPER_TOKENS_CRITICAL:
attributes = {
"str:cm:tokensymbol": payload.tokenSymbol,
"str:cm:email": payload.email,
"str:cm:userId": payload.userId,
"str:cm:criticalDate": payload.criticalDate,
}
break;
case NOTIFICATIONS_EVENT_NAMES.DONATION_RECEIVED:
attributes = {
"str:cm:projecttitle": payload.title,
Expand Down
2 changes: 2 additions & 0 deletions src/types/notifications.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum NOTIFICATIONS_EVENT_NAMES {
USER_SUPER_TOKENS_CRITICAL = 'Supertokens critical',
DRAFTED_PROJECT_ACTIVATED = 'Draft published',
PROJECT_LISTED = 'Project listed',
PROJECT_UNLISTED = 'Project unlisted',
Expand Down Expand Up @@ -47,6 +48,7 @@ export enum NOTIFICATIONS_EVENT_NAMES {
}

export const ORTTO_EVENT_NAMES = {
[NOTIFICATIONS_EVENT_NAMES.USER_SUPER_TOKENS_CRITICAL]: 'superfluid-balance-warning',
[NOTIFICATIONS_EVENT_NAMES.DONATION_RECEIVED]: 'testing-donation-received',
[NOTIFICATIONS_EVENT_NAMES.DRAFTED_PROJECT_ACTIVATED]: 'project-created',
[NOTIFICATIONS_EVENT_NAMES.PROJECT_LISTED]: 'project-listed',
Expand Down
11 changes: 11 additions & 0 deletions src/utils/validators/segmentAndMetadataValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,23 @@ const givBackReadyClaimSchema = Joi.object({
amount: Joi.string().required(),
});

const superFluidTokenTrackerSchema = Joi.object({
tokenSymbol: Joi.string().required(),
email: Joi.string().required(),
userId: Joi.number().required(),
criticalDate: Joi.string().required(),
});

export const SEGMENT_METADATA_SCHEMA_VALIDATOR: {
[key: string]: {
segment: ObjectSchema | null;
metadata: ObjectSchema | null;
};
} = {
userSuperTokensCritical: {
metadata: null,
segment: superFluidTokenTrackerSchema,
},
draftedProjectSavedValidator: {
metadata: projectTitleProjectLinkSchema,
segment: projectRelatedTrackerSchema,
Expand Down

0 comments on commit deb60b8

Please sign in to comment.