Skip to content

Conversation

@lastcanal
Copy link
Contributor

@lastcanal lastcanal commented Jan 8, 2025

This PR implements the company analytics query for the admin dashboard

Some info is not in there yet, such as avg_time_to_fill. Haven't figured out exactly where that info is just yet.

I made some assumptions as to what 'active' orgs and 'successful' contracts are. With this an org is active if it's activated and a contract is successful if it's status is paid or active

last_active_at is currently just using Org#updated_at. We might want to "touch" Org#updated_at on login, or add a last_active_at field to the User/Org model.

It also includes some other random fixes

Screenshot from 2025-01-08 00-26-56

@zcesur
Copy link
Member

zcesur commented Jan 9, 2025

Looking good! Let's agree on a common terminology before putting more work @lastcanal @IoannisFlo, I suggest:

  • active org: org who triggered a GMV event in given period
  • GMV events: bounty.created, bounty.rewarded, contract.payment_escrowed, contract.payment_released etc.
  • successful contract: currently active or paid contract
  • avg time to fill: time from published to accepted, avg over all successful contracts (excl. renewals)

For the last 2, we'll need to add some new fields to contract schema. How about

  • in open contracts (contracts w/o contractor_id) we track :published_at
  • in filled contracts (contracts w/ contractor_id) we track both :published_at (inherited) and :accepted_at

@lastcanal
Copy link
Contributor Author

All of that sounds good! I know this is just an admin view but I wanted to get @IoannisFlo some real data from the get go. I'm working on the notifications now and will be touching most of these events; I might add a User#last_active_at column to make the queries a little simpler and 'touch' it when the 'event' get added to the feed.

@zcesur
Copy link
Member

zcesur commented Jan 10, 2025

Yep that sounds good!

@lastcanal lastcanal force-pushed the admin-company-analytics branch from 702a152 to d62bdc6 Compare January 13, 2025 02:23
@lastcanal lastcanal changed the title Admin company analytics [WIP] feat: company analytics Jan 13, 2025
@zcesur
Copy link
Member

zcesur commented Jan 29, 2025

Hey! Is there anything left to do here?

Can totally skip time_to_fill for now

@zcesur zcesur closed this Apr 2, 2025
@zcesur zcesur deleted the admin-company-analytics branch April 2, 2025 10:58
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.

3 participants