Skip to content

Add "new verified users" to Monthly Key Metrics Report (LG-11164)#9527

Merged
zachmargolis merged 5 commits intomainfrom
margolis-new-verified-users
Nov 3, 2023
Merged

Add "new verified users" to Monthly Key Metrics Report (LG-11164)#9527
zachmargolis merged 5 commits intomainfrom
margolis-new-verified-users

Conversation

@zachmargolis
Copy link
Contributor

@zachmargolis zachmargolis commented Nov 2, 2023

🎫 Ticket

LG-11164

🛠 Summary of changes

Updates total users count section of Monthly Key Metrics Report

  • "New verified" means new since the last month
  • "Annual" means fiscal year-to-date
  • Shows "total users" and "verified users" for each of these

👀 Screenshots

before after
Screenshot 2023-11-02 at 3 54 37 PM Screenshot 2023-11-02 at 3 54 19 PM

- "New verified" means new since the last month

changelog: Internal, Reporting, Update monthly key metrics report
@zachmargolis zachmargolis requested review from a team November 2, 2023 19:57
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

👍


def new_verified_user_count
Reports::BaseReport.transaction_with_timeout do
Profile.where(active: true).where(activated_at: current_month).count
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably an edge case, but would this double-count a user who verified and then re-verified their identity in the same month?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a user can only have one active profile at a time, and we even have that enforced w/ a [user_id, active] unique index in the DB, so it shouldn't double count those users.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I think I had a brain fart and overlooked the active filter.

Comment on lines +74 to +75
Profile.where(active: true).
where(activated_at: annual_start_date..annual_end_date).
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as before, though maybe less of an edge case over the course of a year.

@zachmargolis zachmargolis merged commit f6ccb6d into main Nov 3, 2023
@zachmargolis zachmargolis deleted the margolis-new-verified-users branch November 3, 2023 16:23
@matthinz matthinz mentioned this pull request Nov 6, 2023
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.

2 participants