CollActionteam / collaction_backend

Backend code for CollAction
6 stars 4 forks source link

Award badge CRON job #120

Open rubenhorn opened 2 years ago

rubenhorn commented 2 years ago

Processing lambda:

  1. Load crowdaction details (badge thresholds as implemented in #111 )
  2. Load paricipations for that crowdaction (shared code with #65?)
  3. Foreach participation: a. Compute badge b. Add badge to user profile (âš  Must be atomic operation)
edreinoso commented 2 years ago

date_end will be used to determine when a crowdaction should be closing.

It is really important to know the data type of the date_end. Currently it's only a string in DynamoDB, but this could change depending on the frontend implementation.

Event bridge will be used to put a rule in the event bus that will be triggered based on the crowdaction date end. This will invoke another lambda function that will do the point calculation, and therefore the badge awarding