Skip to content

Commit

Permalink
Merge pull request #23 from DripDropz/staging
Browse files Browse the repository at this point in the history
Track & aggregate is_elimination event type
  • Loading branch information
latheesan-k authored Dec 10, 2024
2 parents fb818a6 + 9f991bc commit a58021c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions application/app/Jobs/HydraDoomAccountStatsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@ public function handle(): void
$projectAccountStats = [
'overview' => self::DEFAULT_STATS,
'qualifier' => self::DEFAULT_STATS,
'elimination' => self::DEFAULT_STATS,
];
$projectAccount->sessionEvents->each(function ($sessionEvent) use (&$projectAccountStats) {
$projectAccountStats['overview'][$sessionEvent->event_type]++;
if (isset($sessionEvent?->eventData?->data['is_qualifier']) && $sessionEvent->eventData->data['is_qualifier'] === true) {
$projectAccountStats['qualifier'][$sessionEvent->event_type]++;
}
if (isset($sessionEvent?->eventData?->data['is_elimination']) && $sessionEvent->eventData->data['is_elimination'] === true) {
$projectAccountStats['qualifier'][$sessionEvent->event_type]++;
}
});

// Upsert project account stats
Expand Down

0 comments on commit a58021c

Please sign in to comment.