fix(portal): don't count internet site in limits (#10336)

Starter plans don't have access to the internet site so it's not fair to
count it against their limits.

Related:
https://app.hubspot.com/contacts/23723443/record/0-5/29628021256
This commit is contained in:
Jamil
2025-09-12 10:11:02 -04:00
committed by GitHub
parent a39e70eb4a
commit c043359c21
2 changed files with 6 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ defmodule Domain.Gateways do
def count_groups_for_account(%Accounts.Account{} = account) do
Group.Query.not_deleted()
|> Group.Query.by_account_id(account.id)
|> Group.Query.by_managed_by(:account)
|> Repo.aggregate(:count)
end

View File

@@ -37,6 +37,11 @@ defmodule Domain.GatewaysTest do
assert count_groups_for_account(account) == 0
end
test "does not count internet site", %{account: account} do
Fixtures.Gateways.create_internet_group(account: account)
assert count_groups_for_account(account) == 0
end
end
describe "fetch_group_by_id/3" do