Skip to content

Commit

Permalink
Add notify reward amount notification fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ae2079 committed Jun 18, 2024
1 parent 200c4f9 commit ad698ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/services/notificationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,19 @@ const activityCreator = (payload: any, orttoEventName: NOTIFICATIONS_EVENT_NAMES
"str:cm:userid": payload.userId?.toString(),
}
break
case NOTIFICATIONS_EVENT_NAMES.NOTIFY_REWARD_AMOUNT:
attributes = {
"int:cm:round": payload.round,
"str:cm:date": payload.date,
"str:cm:amount": payload.amount,
"str:cm:contractaddress": payload.contractAddress,
"str:cm:farm": payload.farm,
"str:cm:message": payload.message,
"str:cm:network": payload.network,
"str:cm:script": payload.script,
"str:cm:transactionhash": payload.transactionHash,
}
break
default:
logger.debug('activityCreator() invalid event name', orttoEventName)
return;
Expand Down
4 changes: 4 additions & 0 deletions src/validators/schemaValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ export const sendNotificationValidator = Joi.object({

// Project update
update: Joi.string(),

// Notify reward attributes
contractAddress: Joi.string(),
farm: Joi.string(),
}),
}),
});
Expand Down

0 comments on commit ad698ca

Please sign in to comment.