Skip to content

refactor: enrich agents overview page with useful information #1492#1493

Merged
beesaferoot merged 3 commits into
mainfrom
improv/agent-sales-stat
Jun 2, 2026
Merged

refactor: enrich agents overview page with useful information #1492#1493
beesaferoot merged 3 commits into
mainfrom
improv/agent-sales-stat

Conversation

@beesaferoot
Copy link
Copy Markdown
Contributor

Closes #1492

Brief summary of the change made

Are there any other side effects of this change that we should be aware of?

Describe how you tested your changes?

Pull Request checklist

Please confirm you have completed any of the necessary steps below.

  • Meaningful Pull Request title and description
  • Changes tested as described above
  • Added appropriate documentation for the change.
  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

@beesaferoot beesaferoot requested a review from dmohns June 1, 2026 20:40
Copy link
Copy Markdown
Member

@dmohns dmohns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +125 to +126
->withCount(['soldAppliances as sales_count'])
->withExists(['balanceHistory as is_active' => fn (Builder $query) => $query->where('created_at', '>=', now()->subDays(self::ACTIVE_WINDOW_DAYS))]);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
->withCount(['soldAppliances as sales_count'])
->withExists(['balanceHistory as is_active' => fn (Builder $query) => $query->where('created_at', '>=', now()->subDays(self::ACTIVE_WINDOW_DAYS))]);
->withCount(['soldAppliances AS sales_count'])
->withExists(['balanceHistory AS is_active' => fn (Builder $query) => $query->where('created_at', '>=', now()->subDays(self::ACTIVE_WINDOW_DAYS))]);

Tiny nit: Let's use capitalised SQL keywords (like you are already doing above for COUNT and DISTINCT.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and ready for review.

@beesaferoot beesaferoot requested a review from dmohns June 2, 2026 07:41
@beesaferoot beesaferoot merged commit de857b3 into main Jun 2, 2026
17 checks passed
@beesaferoot beesaferoot deleted the improv/agent-sales-stat branch June 2, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Agents Overview page metrics should match data in Agent performance dashboard

2 participants