Skip to content
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

Check to see if any of the list of achievements earns a reward and if so register the rewards in Hasura #472

Open
philhawksworth opened this issue Feb 8, 2021 · 0 comments

Comments

@philhawksworth
Copy link
Contributor

philhawksworth commented Feb 8, 2021

Triggered by write events on the achievements table, a serverless function for each reward should be called as a webhook.

These functions should:

  • inspect what achievements exist for a given user
  • for any achievements determined to yield a reward, create an entry in the rewards table which captures any links, keys, codes, or integration data needed for the fulfilment of that reward.
  • Update the corresponding row in the achievements table to record the id of this item in the rewards table

This issues is to track the work to create the rewards-check function for the stickers reward for a user completing their first mission.

Associated detail provided in this comment by @tzmanics

@philhawksworth philhawksworth changed the title Check to see if any of the list of achievements earns a reward and if so, update the achievements table to indicate this. Check to see if any of the list of achievements earns a reward and if so register the rewards in Hasura Feb 12, 2021
bencodezen added a commit that referenced this issue Mar 8, 2021
bencodezen added a commit that referenced this issue Mar 8, 2021
bencodezen added a commit that referenced this issue Mar 8, 2021
bencodezen added a commit that referenced this issue Mar 8, 2021
bencodezen added a commit that referenced this issue Mar 8, 2021
bencodezen added a commit that referenced this issue Mar 8, 2021
bencodezen added a commit that referenced this issue Mar 12, 2021
* feature: add check that change is called

* config: update package lock

* feature: log more detailed event

* feature: define achievement

* feature (#472): add check reward function

* fix (#472): variable typo

* feature (#472): add better messages

* docs (#472): provide code comments
bencodezen added a commit that referenced this issue Mar 15, 2021
* feature: add check that change is called

* config: update package lock

* feature: log more detailed event

* feature: define achievement

* feature (#472): add check reward function

* fix (#472): variable typo

* feature (#472): add better messages

* docs (#472): provide code comments
bencodezen added a commit that referenced this issue Mar 22, 2021
* feature (#457): scaffold price rule post request

* docs (#457): add task for authentication

* PR'ing achievement UI into the feature branch (#485)

* WIP: added achievement notif

* Remove comments

* Achievement UI Spike

* user achievement flow ok

* Achievement Spike New UI

* Clean up the logs

* feature: allows us to programmatically create a price rule with graphql api

* feature: add discount code with removal of old code

* feature (#472): add check reward function (#488)

* feature: add check that change is called

* config: update package lock

* feature: log more detailed event

* feature: define achievement

* feature (#472): add check reward function

* fix (#472): variable typo

* feature (#472): add better messages

* docs (#472): provide code comments

* feature (#457): scaffold price rule post request

* docs (#457): add task for authentication

* feature: allows us to programmatically create a price rule with graphql api

* feature: add discount code with removal of old code

* feature: add test out event payload

* feature: add discount code

* docs: add notes

* config: update package lock

* refactor: consolidate discount code into one serverless function

* fix: authentication with shopify

* feature: add dynamic code and date

* fix: re-enable dynamic event data

* feature: add discount code to reward table

* feature: customize price rule with achievement id

* feature: add error state if shopify reward creation fails

* refactor: add try catch to improve code thanks to Sarah

Co-authored-by: Ekene Eze <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants