Skip to content

Commit e155940

Browse files
committed
add todos
1 parent 39a7834 commit e155940

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/algora/analytics/analytics.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ defmodule Algora.Analytics do
88

99
require Algora.SQL
1010

11+
# TODO
12+
#
13+
# active org: org who triggered a GMV event in given period
14+
# GMV events: bounty.created, bounty.rewarded, contract.payment_escrowed, contract.payment_released etc.
15+
# successful contract: currently active or paid contract
16+
# avg time to fill: time from published to accepted, avg over all successful contracts (excl. renewals)
17+
1118
def get_company_analytics(period \\ "30d", from \\ DateTime.utc_now()) do
1219
days = period |> String.replace("d", "") |> String.to_integer()
1320
period_start = DateTime.add(from, -days * 24 * 3600)
@@ -99,6 +106,9 @@ defmodule Algora.Analytics do
99106
active_change: orgs.active_current,
100107
active_trend: calculate_trend(orgs.active_current, orgs.active_previous),
101108
# TODO track time when contract is filled
109+
#
110+
# in open contracts (contracts w/o contractor_id) we track :published_at
111+
# in filled contracts (contracts w/ contractor_id) we track both :published_at (inherited) and :accepted_at
102112
avg_time_to_fill: 0.0,
103113
time_to_fill_change: -0.0,
104114
time_to_fill_trend: :down,

0 commit comments

Comments
 (0)