Skip to content

Commit 8b09997

Browse files
committed
ignore org.seeded
1 parent 031f890 commit 8b09997

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/algora/analytics/analytics.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ defmodule Algora.Analytics do
2121
count_current: u.id |> count() |> filter(u.inserted_at <= ^from and u.inserted_at >= ^period_start),
2222
count_previous:
2323
u.id |> count() |> filter(u.inserted_at <= ^period_start and u.inserted_at >= ^previous_period_start),
24-
active_all: u.id |> count() |> filter(u.seeded and u.activated),
24+
active_all: u.id |> count() |> filter(u.activated),
2525
active_current:
2626
u.id
2727
|> count()
28-
|> filter(u.seeded and u.activated and u.inserted_at <= ^from and u.inserted_at >= ^period_start),
28+
|> filter(u.activated and u.inserted_at <= ^from and u.inserted_at >= ^period_start),
2929
active_previous:
3030
u.id
3131
|> count()
3232
|> filter(
33-
u.seeded and u.activated and u.inserted_at <= ^period_start and u.inserted_at >= ^previous_period_start
33+
u.activated and u.inserted_at <= ^period_start and u.inserted_at >= ^previous_period_start
3434
)
3535
}
3636

test/algora/analytics_test.exs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ defmodule Algora.AnalyticsTest do
1010
last_month = DateTime.add(now, -40 * 24 * 3600)
1111

1212
Enum.reduce(1..100, now, fn _n, date ->
13-
insert(:organization, %{inserted_at: date, seeded: false, activated: false})
13+
insert(:organization, %{inserted_at: date, activated: false})
1414
DateTime.add(date, -1 * 24 * 3600)
1515
end)
1616

1717
Enum.reduce(1..100, now, fn _n, date ->
18-
org = insert(:organization, %{inserted_at: date, seeded: true, activated: true})
18+
org = insert(:organization, %{inserted_at: date, activated: true})
1919
insert_list(2, :contract, %{client_id: org.id, status: :active})
2020
insert_list(1, :contract, %{client_id: org.id, status: :paid})
2121
insert_list(3, :contract, %{client_id: org.id, status: :cancelled})
@@ -49,7 +49,7 @@ defmodule Algora.AnalyticsTest do
4949

5050
now = DateTime.utc_now()
5151
last_month = DateTime.add(now, -40 * 24 * 3600)
52-
insert(:organization, %{inserted_at: last_month, seeded: true, activated: true})
52+
insert(:organization, %{inserted_at: last_month, activated: true})
5353

5454
{:ok, resp} = Analytics.get_company_analytics("30d")
5555
assert resp.total_companies == 201
@@ -59,9 +59,9 @@ defmodule Algora.AnalyticsTest do
5959
assert resp.companies_trend == :down
6060
assert resp.active_trend == :down
6161

62-
insert(:organization, %{seeded: true, activated: true})
63-
insert(:organization, %{seeded: true, activated: true})
64-
insert(:organization, %{seeded: false, activated: false})
62+
insert(:organization, %{activated: true})
63+
insert(:organization, %{activated: true})
64+
insert(:organization, %{activated: false})
6565

6666
{:ok, resp} = Analytics.get_company_analytics("30d")
6767

@@ -84,7 +84,7 @@ defmodule Algora.AnalyticsTest do
8484
end
8585

8686
test "get_company_analytics 7d" do
87-
insert(:organization, %{seeded: true, activated: true})
87+
insert(:organization, %{activated: true})
8888
{:ok, resp} = Analytics.get_company_analytics("7d")
8989
assert resp.total_companies == 201
9090
assert resp.active_companies == 101

0 commit comments

Comments
 (0)