Skip to content

Commit

Permalink
[C-4293] Add cooldown days to challenge definitions in jsons for dev …
Browse files Browse the repository at this point in the history
…and stage envs (#8178)

Co-authored-by: Saliou Diallo <[email protected]>
  • Loading branch information
sddioulde and Saliou Diallo authored Apr 22, 2024
1 parent e190a34 commit f3aed8c
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 25 deletions.
44 changes: 32 additions & 12 deletions packages/discovery-provider/src/challenges/challenges.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,95 @@
"id": "listen-streak",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000
},
{
"id": "track-upload",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "referrals",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "ref-v",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "referred",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "connect-verified",
"active": true,
"starting_block": 0,
"amount": 5
"amount": 5,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "mobile-install",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "tt",
"active": true,
"starting_block": 0,
"amount": 100
"amount": 100,
"weekly_pool": 500
},
{
"id": "tut",
"active": true,
"starting_block": 0,
"amount": 100
"amount": 100,
"weekly_pool": 500
},
{
"id": "tp",
"active": true,
"starting_block": 0,
"amount": 100
"amount": 100,
"weekly_pool": 500
},
{
"id": "send-first-tip",
"type": "boolean",
"amount": 2,
"active": true,
"starting_block": 0
"starting_block": 0,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "first-playlist",
"type": "boolean",
"amount": 2,
"active": true,
"starting_block": 0
"starting_block": 0,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "b",
Expand Down
44 changes: 32 additions & 12 deletions packages/discovery-provider/src/challenges/challenges.stage.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,95 @@
"id": "listen-streak",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000
},
{
"id": "track-upload",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "referrals",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "ref-v",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "referred",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "connect-verified",
"active": true,
"starting_block": 0,
"amount": 5
"amount": 5,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "mobile-install",
"active": true,
"starting_block": 0,
"amount": 1
"amount": 1,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "tt",
"active": true,
"starting_block": 0,
"amount": 100
"amount": 100,
"weekly_pool": 500
},
{
"id": "tut",
"active": true,
"starting_block": 0,
"amount": 100
"amount": 100,
"weekly_pool": 500
},
{
"id": "tp",
"active": true,
"starting_block": 0,
"amount": 100
"amount": 100,
"weekly_pool": 500
},
{
"id": "send-first-tip",
"type": "boolean",
"amount": 2,
"active": true,
"starting_block": 0
"starting_block": 0,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "first-playlist",
"type": "boolean",
"amount": 2,
"active": true,
"starting_block": 0
"starting_block": 0,
"weekly_pool": 25000,
"cooldown_days": 7
},
{
"id": "b",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def create_new_challenges(session, allowed_challenge_types=None):
challenges.append(challenge)
session.add_all(challenges)

# Update any challenges whose active state / amount / step count / starting block changed
# Update any challenges whose active state / amount / step count / starting block / weekly pool / cooldown days changed
existing_challenge_map = {
challenge.id: challenge for challenge in existing_challenges
}
Expand Down

0 comments on commit f3aed8c

Please sign in to comment.