From 5f1de88a0d0d54219174ba3c3699239ff3e4711a Mon Sep 17 00:00:00 2001 From: hq1 Date: Tue, 7 Jan 2025 12:40:24 +0100 Subject: [PATCH] Teams setup schema (#4944) * Add team-setup related flags to Team schema * Diverge from schema-defaults in test factories --- lib/plausible/teams/team.ex | 3 +++ test/support/factory.ex | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/plausible/teams/team.ex b/lib/plausible/teams/team.ex index ebbf0bc1857a..76a2c2a8c462 100644 --- a/lib/plausible/teams/team.ex +++ b/lib/plausible/teams/team.ex @@ -25,6 +25,9 @@ defmodule Plausible.Teams.Team do field :accept_traffic_until, :date field :allow_next_upgrade_override, :boolean, default: false + field :setup_complete, :boolean, default: false + field :setup_at, :naive_datetime + embeds_one :grace_period, Plausible.Auth.GracePeriod, on_replace: :update has_many :sites, Plausible.Site diff --git a/test/support/factory.ex b/test/support/factory.ex index 5126b3552dca..30165d7075a1 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -6,7 +6,9 @@ defmodule Plausible.Factory do def team_factory do %Plausible.Teams.Team{ name: "My Team", - trial_expiry_date: Timex.today() |> Timex.shift(days: 30) + trial_expiry_date: Timex.today() |> Timex.shift(days: 30), + setup_complete: true, + setup_at: NaiveDateTime.utc_now() } end