Api reference
components.gamification.public.business_logic ¶
actions ¶
player ¶
merge_users_in_gamification_component ¶
Support function for the "merge user" procedure: changes the source player user id to the target user id.
The targeted user id cannot already be a player, in this case this will fail
Source code in components/gamification/internal/business_logic/actions/player.py
components.gamification.public.commands ¶
app_group ¶
backfill_activity_trip_diagnostics ¶
Backfill legacy user_feedback into split format (cleartext + encrypted diagnostic_data).
backfill_activity_trip_diagnostics ¶
Backfill legacy user_feedback into cleartext + encrypted diagnostic_data.
Migrates untouched legacy rows (encrypted feedback with payload inside) to the new split format: plaintext feedback in user_feedback, encrypted diagnostics in diagnostic_data. Safe to re-run (idempotent per row).
Source code in components/gamification/public/commands/backfill_activity_trip_diagnostics.py
backfill_favorite_categories ¶
backfill_favorite_categories ¶
Backfill favorite_challenges for players with NULL values.
Source code in components/gamification/public/commands/backfill_favorite_categories.py
cleanup_duels ¶
cleanup_duels ¶
Cleanup duels that never had winners (usually if the player never opens the duel after results are ready) This also refunds both players
Source code in components/gamification/public/commands/cleanup_duels.py
cleanup_players ¶
cleanup_players ¶
Cleanup players (eg. those who are not insured anymore)
Source code in components/gamification/public/commands/cleanup_players.py
compute_alan_cup_underdogs ¶
compute_alan_cup_underdogs ¶
Compute and print the bottom 25% of each Alan Cup league for the past week.
Output is split into two lists for the LaunchDarkly play-alan-cup-underdog-bonus
flag targeting:
- account_ids: entities with no company_id (whole-account)
- company_ids: entities with a company_id (entity-split accounts)
Source code in components/gamification/public/commands/compute_alan_cup_underdogs.py
compute_month_winners ¶
compute_month_winners ¶
Compute monthly winners (team challenge)
Source code in components/gamification/public/commands/compute_month_winners.py
compute_week_winners ¶
compute_weekly_global_podium ¶
Find the global podium for the week amongst all alan members
Source code in components/gamification/public/commands/compute_week_winners.py
compute_weekly_leaderboard_winners ¶
compute_weekly_leaderboard_winners(
dry_run,
app_id,
expected_paris_hour=None,
expected_toronto_hour=None,
)
Compute week winners (league leaderboards)
Source code in components/gamification/public/commands/compute_week_winners.py
compute_weekly_leaderboard_winners_retroactively ¶
Compute weekly leaderboard winners retroactively
Source code in components/gamification/public/commands/compute_week_winners.py
refresh_weekly_leaderboard_records_retroactively ¶
Refresh leaderboards records retroactively
Source code in components/gamification/public/commands/compute_week_winners.py
delete_old_achievements ¶
delete_old_achievements ¶
Delete old achievements
Source code in components/gamification/public/commands/delete_old_achievements.py
diagnose_activity_trips ¶
diagnose_activity_trips ¶
Fetch + decrypt + analyze activity trips in one step, printing a readable diagnostic report per trip (verdict, GPS speed/noise profile, missing-ride logs). Same filters as export_activity_trips, but the report instead of raw JSON, so no local file round-trip:
alan qovery run backend-fr--prod \ "flask gamification diagnose_activity_trips --external-id ABC"
Source code in components/gamification/public/commands/diagnose_activity_trips.py
eligibility ¶
COUNTRIES_TO_APP_ID
module-attribute
¶
check_gamification_configuration ¶
Check gamification configurations
Source code in components/gamification/public/commands/eligibility.py
register_gamification_configurations ¶
Register gamification configurations of future accounts or old accounts that were missed somehow
Source code in components/gamification/public/commands/eligibility.py
export_activity_trips ¶
export_activity_trips ¶
export_activity_trips(
external_ids,
status,
review_status,
only_with_feedback,
comment,
platform,
limit,
probe,
)
Decrypt and dump activity trips as a JSON array to stdout for diagnosis. Redirect to capture locally, e.g.:
alan qovery run backend-fr--prod \ "flask gamification export_activity_trips --comment not_bike" > trips.json
Source code in components/gamification/public/commands/export_activity_trips.py
reset_player_info ¶
reset_player_info ¶
Removes all gamification info linked to a player following withdrawal of consent
Source code in components/gamification/public/commands/reset_player_info.py
resync_players_preferences_with_customerio ¶
resync_players_preferences_with_customerio ¶
Resync all players preferences with customer CIO
Source code in components/gamification/public/commands/resync_players_preferences_with_customerio.py
team_challenge ¶
auto_assign_unassigned_players_to_teams ¶
Auto-assign unassigned players to teams
Source code in components/gamification/public/commands/team_challenge.py
cleanup_team_challenges ¶
Cleanup team challenges
For challenges that are started - cleanup teams that have been created automatically at initialization but have only one player assigned and are not customized
Source code in components/gamification/public/commands/team_challenge.py
initialize_team_challenges ¶
Initialize team challenges
For accounts that are declared with a start date but not set yet: - initialize teams_size from number of enrolled players - generate default teams and captain assignation
Source code in components/gamification/public/commands/team_challenge.py
vouchers ¶
reconsolidate_gamification_vouchers_state ¶
Reconsolidate gamification vouchers state based on shopify discounts state - If discount code appears in a not cancelled order, the command will ensure the related voucher is marked as used - If discount code appears in a cancelled order, the command will ensure the related voucher is re-regenerated and not marked as used
Source code in components/gamification/public/commands/vouchers.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
components.gamification.public.controllers ¶
achievements ¶
CollectAchievementsPayload
dataclass
¶
DeclareAchievementPayload
dataclass
¶
GetAchievementsPayload
dataclass
¶
WHITELISTED_CLIENT_ACHIEVEMENT_CODES
module-attribute
¶
WHITELISTED_CLIENT_ACHIEVEMENT_CODES = {
activation_wheel,
baby_sleep_completed,
backpain_completed,
debug,
stress_program_completed,
play_scratch,
play_scratch_25_1,
play_scratch_25_2,
play_scratch_25_3,
play_scratch_25_4,
play_scratch_200_1,
play_scratch_tp_card,
play_scratch_200_prevenir,
play_scratch_200_mbappe_raffle_winners,
streak_7d,
streak_20d,
streak_50d,
streak_100d,
streak_150d,
streak_200d,
streak_250d,
streak_300d,
streak_365d,
streak_500d,
streak_600d,
streak_700d,
streak_800d,
streak_900d,
streak_1000d,
not_cycling_feedback,
shop_eyewear_vto_frames_tried,
tp_card_added_to_wallet,
mo_first_discussion,
team_challenge_mission_completed,
guess_who_try_1,
guess_who_try_2,
guess_who_try_3,
}
gamification_achievements_blp
module-attribute
¶
gamification_achievements_blp = CustomBlueprint(
"gamification_achievements",
__name__,
url_prefix="/api/gamification/achievements",
)
activities ¶
gamification_activities_public_blp
module-attribute
¶
gamification_activities_public_blp = CustomBlueprint(
"gamification_activities_public",
__name__,
url_prefix="/api/gamification/activities",
auth_context_providers=[AnonymousAuthContextProvider()],
)
activity_trip ¶
gamification_activity_trips_blp
module-attribute
¶
gamification_activity_trips_blp = CustomBlueprint(
"gamification_activity_trips",
__name__,
url_prefix="/api/gamification/activity_trips",
)
alan_cup ¶
SetAlanCupEntityDisplayNamePayload
dataclass
¶
JSON body for POST /alan_cup/entities/
display_name
class-attribute
instance-attribute
¶
SetAlanCupQvctTrackPayload
dataclass
¶
JSON body for POST /alan_cup/qvct_track.
track is one of ALAN_CUP_QVCT_TRACKS or null to clear the selection.
track
class-attribute
instance-attribute
¶
gamification_alan_cup_blp
module-attribute
¶
gamification_alan_cup_blp = CustomBlueprint(
"gamification_alan_cup",
__name__,
url_prefix="/api/gamification/alan_cup",
)
alan_cup_admin ¶
AlanCupAdminDashboardGetQuerySchema
dataclass
¶
CanAdminAlanCupEntityPolicy ¶
Bases: AccessPolicy
Caller must be admin of the targeted account/company.
evaluate
classmethod
¶
True iff caller can admin the entity targeted by payload.
Source code in components/gamification/public/controllers/alan_cup_admin.py
policy_id
class-attribute
instance-attribute
¶
CreateHqBoostPostJsonSchema
dataclass
¶
gamification_alan_cup_admin_blp
module-attribute
¶
gamification_alan_cup_admin_blp = CustomBlueprint(
"gamification_alan_cup_admin",
__name__,
url_prefix="/api/gamification/alan_cup",
)
badges ¶
GetBadgeSeriesPayload
dataclass
¶
Query parameters for GET /badges/series
MarkBadgesAsSeenPayload
dataclass
¶
Query parameters for POST /badges/mark_as_displayed
gamification_badges_blp
module-attribute
¶
gamification_badges_blp = CustomBlueprint(
"gamification_badges",
__name__,
url_prefix="/api/gamification/badges",
)
mark_badges_as_seen ¶
Mark some badges as seen in the frontend. This ensures we don't show them again in the future.
Source code in components/gamification/public/controllers/badges.py
boosts ¶
charity ¶
cycling ¶
daily_challenge ¶
CreateStreakFreezePayload
dataclass
¶
Schema for POST /daily_challenge/freeze.
GetDailyChallengeStreakPayload
dataclass
¶
gamification_daily_challenge_blp
module-attribute
¶
gamification_daily_challenge_blp = CustomBlueprint(
"gamification_daily_challenge",
__name__,
url_prefix="/api/gamification/daily_challenge",
)
declarative_challenge ¶
gamification_declarative_challenge_blp
module-attribute
¶
gamification_declarative_challenge_blp = CustomBlueprint(
"gamification_declarative_challenge",
__name__,
url_prefix="/api/gamification/declarative_challenges",
)
gamification_declarative_challenge_public_blp
module-attribute
¶
gamification_declarative_challenge_public_blp = CustomBlueprint(
"gamification_declarative_challenge_public",
__name__,
url_prefix="/api/gamification/declarative_challenges",
auth_context_providers=[AnonymousAuthContextProvider()],
)
duels ¶
image_composer ¶
gamification_image_composer_public_blp
module-attribute
¶
gamification_image_composer_public_blp = CustomBlueprint(
"gamification_image_composer",
__name__,
url_prefix="/api/gamification/image_composer",
auth_context_providers=[AnonymousAuthContextProvider()],
)
level ¶
gamification_level_blp
module-attribute
¶
gamification_level_blp = CustomBlueprint(
"gamification_level",
__name__,
url_prefix="/api/gamification/level",
)
marmot ¶
gamification_marmot_blp
module-attribute
¶
gamification_marmot_blp = CustomBlueprint(
"gamification_marmot",
__name__,
url_prefix="/api/gamification/marmot",
)
mo ¶
play_history ¶
player ¶
players ¶
points ¶
purchases ¶
CreatePurchasePayload
dataclass
¶
gamification_purchases_blp
module-attribute
¶
gamification_purchases_blp = CustomBlueprint(
"gamification_purchases",
__name__,
url_prefix="/api/gamification/purchases",
)
get_purchases ¶
Source code in components/gamification/public/controllers/purchases.py
reactions ¶
CreateReactionPayload
dataclass
¶
CreateReactionPayload(
receiver_id=None,
emoji=None,
note=None,
origin=None,
origin_id=None,
limit_per_day=None,
team_id=None,
)
Args for POST /reactions.
DeprecatedReportReactionPayload
dataclass
¶
ReportReactionPayload
dataclass
¶
Args for POST /reactions/
gamification_reactions_blp
module-attribute
¶
gamification_reactions_blp = CustomBlueprint(
"gamification_reactions",
__name__,
url_prefix="/api/gamification/reactions",
)
records ¶
scores ¶
stats ¶
streaks ¶
team_challenge ¶
AskBoostWithMessagePayload
dataclass
¶
CreateBoostPayload
dataclass
¶
CreateTeamPayload
dataclass
¶
GetFeedPayload
dataclass
¶
GetLeaderboardPayload
dataclass
¶
GetTeamPayload
dataclass
¶
InviteToTeamChallengePayload
dataclass
¶
JoinTeamLegacyPayload
dataclass
¶
UpdateTeamPayload
dataclass
¶
gamification_team_challenge_blp
module-attribute
¶
gamification_team_challenge_blp = CustomBlueprint(
"gamification_team_challenge",
__name__,
url_prefix="/api/gamification/team_challenge",
)
users ¶
utils ¶
inject_player_context ¶
Source code in components/gamification/public/controllers/utils.py
vouchers ¶
walk_challenge ¶
CreateWalkFeedbackPayload
dataclass
¶
Payload for the create walk feedback endpoint.
GetEligibilityPayload
dataclass
¶
Query args for the eligibility endpoint. optional account_id and company_id to resolve ambiguities in case admin is admin of multiple accounts or companies Otherwise eligibility will be based on player context
JoinWalkPayload
dataclass
¶
SetProgressPayload
dataclass
¶
gamification_walking_challenge_blp
module-attribute
¶
gamification_walking_challenge_blp = CustomBlueprint(
"gamification_walking_challenge",
__name__,
url_prefix="/api/gamification/walking_challenge",
)
gamification_walking_challenge_public_blp
module-attribute
¶
gamification_walking_challenge_public_blp = CustomBlueprint(
"gamification_walking_challenge_public",
__name__,
url_prefix="/api/gamification/walking_challenge",
auth_context_providers=[AnonymousAuthContextProvider()],
)
walk_history ¶
gamification_walking_history_blp
module-attribute
¶
gamification_walking_history_blp = CustomBlueprint(
"gamification_walking_history",
__name__,
url_prefix="/api/gamification/walking_history",
)
walk_leagues ¶
BeneficiarySkinPayload
dataclass
¶
CreateLeaguePayload
dataclass
¶
GetAllLeaguesPayload
dataclass
¶
GetAllLeaguesPayload(
past_week=None,
include_entries=True,
include_members=False,
include_mines=True,
include_others=True,
include_statistics=True,
)
GetAllLeaguesPositionsPayload
dataclass
¶
InvitePlayersPayload
dataclass
¶
gamification_walk_leagues_blp
module-attribute
¶
gamification_walk_leagues_blp = CustomBlueprint(
"gamification_walk_leagues",
__name__,
url_prefix="/api/gamification/walk_leagues",
)
components.gamification.public.dependency ¶
BeneficiaryData
dataclass
¶
GamificationAccountAdminEnrollmentData
dataclass
¶
GamificationDependency ¶
Bases: ABC
get_account_admin_enrollment
abstractmethod
¶
get_account_from_company
abstractmethod
¶
get_account_name
abstractmethod
¶
get_first_and_last_names_from_user_ids
abstractmethod
¶
get_player_ids_to_cleanup
abstractmethod
¶
get_reference_timezone
abstractmethod
¶
get_user_beneficiaries_cached
abstractmethod
¶
Get beneficiaries of a user's policy with policy information
get_user_enrollment
abstractmethod
¶
is_feature_enabled_for_user_id
abstractmethod
¶
Return True if the feature is enabled for the user, False otherwise
is_user_alaner
abstractmethod
¶
search_entity_users
abstractmethod
¶
GamificationUserEnrollmentData
dataclass
¶
UserBeneficiariesResult
dataclass
¶
Bases: DataClassJsonMixin
Result containing user beneficiaries and policy information.
The policy_id attribute is used to scope the BeneficiaryLeagueSkin to a given company.
It does NOT have to match the internal Policy ID used in other components.
__post_init__ ¶
get_app_dependency ¶
Get the GamificationDependency for the current Flask app
Source code in components/gamification/public/dependency.py
set_app_dependency ¶
Set the GamificationDependency for the current Flask app
Source code in components/gamification/public/dependency.py
components.gamification.public.entities ¶
components.gamification.public.enums ¶
achievement_definition ¶
AchievementCode ¶
Bases: AlanBaseEnum
Achievement codes for the gamification system. These codes are used to identify specific achievements that players can earn.
baby_sleep_completed
class-attribute
instance-attribute
¶
back_pain_program_exercise
class-attribute
instance-attribute
¶
berries_leaderboard_1
class-attribute
instance-attribute
¶
berries_leaderboard_10p
class-attribute
instance-attribute
¶
berries_leaderboard_2
class-attribute
instance-attribute
¶
berries_leaderboard_3
class-attribute
instance-attribute
¶
berries_leaderboard_5p
class-attribute
instance-attribute
¶
breathing_qvct_zen_d1
class-attribute
instance-attribute
¶
care_incompatible_device
class-attribute
instance-attribute
¶
health_program_exercise
class-attribute
instance-attribute
¶
health_program_qvct_move_d2
class-attribute
instance-attribute
¶
health_program_qvct_move_d4
class-attribute
instance-attribute
¶
health_program_qvct_zen_d4
class-attribute
instance-attribute
¶
joined_longevity_waitlist
class-attribute
instance-attribute
¶
journaling_qvct_zen_d3
class-attribute
instance-attribute
¶
km_charity_donation
class-attribute
instance-attribute
¶
mo_first_discussion
class-attribute
instance-attribute
¶
not_cycling_feedback
class-attribute
instance-attribute
¶
play_scratch_200_mbappe_raffle_winners
class-attribute
instance-attribute
¶
play_scratch_200_prevenir
class-attribute
instance-attribute
¶
play_scratch_tp_card
class-attribute
instance-attribute
¶
qvct_full_move_week
class-attribute
instance-attribute
¶
shop_contacts_purchase
class-attribute
instance-attribute
¶
shop_eyewear_purchase
class-attribute
instance-attribute
¶
shop_eyewear_vto_frames_tried
class-attribute
instance-attribute
¶
shop_wellbeing_purchase
class-attribute
instance-attribute
¶
special_guest_duel_100
class-attribute
instance-attribute
¶
special_guest_duel_1000
class-attribute
instance-attribute
¶
special_guest_duel_200
class-attribute
instance-attribute
¶
special_guest_duel_50
class-attribute
instance-attribute
¶
special_guest_duel_500
class-attribute
instance-attribute
¶
stress_program_completed
class-attribute
instance-attribute
¶
stress_program_exercise
class-attribute
instance-attribute
¶
team_challenge_mission_completed
class-attribute
instance-attribute
¶
tp_card_added_to_wallet
class-attribute
instance-attribute
¶
walk_30min_milestone
class-attribute
instance-attribute
¶
walk_5min_milestone
class-attribute
instance-attribute
¶
walk_brisk_10min_milestone1
class-attribute
instance-attribute
¶
walk_brisk_10min_milestone2
class-attribute
instance-attribute
¶
walk_brisk_10min_milestone3
class-attribute
instance-attribute
¶
walk_brisk_20min_milestone1
class-attribute
instance-attribute
¶
walk_brisk_20min_milestone2
class-attribute
instance-attribute
¶
walk_brisk_20min_milestone3
class-attribute
instance-attribute
¶
walking_challenge_referral_use
class-attribute
instance-attribute
¶
walking_challenge_referral_used
class-attribute
instance-attribute
¶
walking_challenge_started
class-attribute
instance-attribute
¶
walking_challenge_top_10_percent
class-attribute
instance-attribute
¶
walking_challenge_top_5_percent
class-attribute
instance-attribute
¶
walking_challenge_week_1st
class-attribute
instance-attribute
¶
walking_challenge_week_2nd
class-attribute
instance-attribute
¶
walking_challenge_week_3rd
class-attribute
instance-attribute
¶
activity_trip ¶
ActivityTripReviewStatus ¶
Bases: AlanBaseEnum
Operator review state for disputed trips.
none: never flagged for review.
pending: under operator review.
completed: reviewed; outcome reflected in the status column.
cannot_determine: reviewed but operator could not conclude.
ActivityTripStatus ¶
Bases: AlanBaseEnum
Lifecycle status of an activity trip.
accepted: trip detected and kept. rejected: trip detected but discarded by the algorithm. not_detected: user-reported missing ride.
leagues ¶
records ¶
components.gamification.public.helpers ¶
data_loader ¶
We need static data to exist in the local database for the component to work properly.
load_gamification_store_base_data ¶
Source code in components/gamification/public/helpers/data_loader.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
player_authorisation ¶
get_other_player_context_if_authorised ¶
Source code in components/gamification/public/helpers/player_authorisation.py
get_other_player_id_if_authorized ¶
Source code in components/gamification/public/helpers/player_authorisation.py
shop_rewards ¶
compute_shop_berries_reward_for_product_cost ¶
Compute the berries reward for a product cost in the shop. The reward is calculated as 1% of the product cost, multiplied by 30. Make sure to keep in sync with computeShopBerriesRewardForProductCost
Source code in components/gamification/public/helpers/shop_rewards.py
components.gamification.public.services ¶
achievements ¶
declare_achievement_for_app_user ¶
Declare an achievement for a player identified by their app user ID.
Source code in components/gamification/public/services/achievements.py
has_achieved ¶
Check if a player has ever earned a given achievement.
Source code in components/gamification/public/services/achievements.py
has_achieved_after ¶
Check if a player has earned a given achievement after a given date.
Source code in components/gamification/public/services/achievements.py
engagement_summary ¶
get_play_engagement_summary_for_user_id ¶
Aggregate Play engagement for a member for a user_id.
Returns an empty summary when the user has no Player row (never onboarded
into Play)
Source code in components/gamification/public/services/engagement_summary.py
player ¶
get_player_id_from_user_id ¶
Retrieve players based on an app user IDs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
str
|
app user IDs. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
UUID |
UUID | None
|
Corresponding player ID |
Source code in components/gamification/public/services/player.py
remove_player_data ¶
Removes all gamification info linked to a player Connects purchases to a fake player Reset player object fields
Source code in components/gamification/public/services/player.py
vouchers ¶
generate_discount_code ¶
Public wrapper to generate a fresh voucher discount code.
Source code in components/gamification/public/services/vouchers.py
get_voucher_amount_in_euros ¶
Public accessor for the euro amount associated with a VoucherCode.
Source code in components/gamification/public/services/vouchers.py
list_vouchers_for_user ¶
Public accessor: list a user's vouchers by app_user_id.
Returns an empty list if the user has no player record.
Source code in components/gamification/public/services/vouchers.py
record_voucher_for_user ¶
Public wrapper to persist a Voucher row for the given user. Caller owns any external side-effect (e.g. discount provider creation).