Fix Gaiia GraphQL: SubscriptionStatus is scalar, not object

This commit is contained in:
Graham McIntire 2026-02-14 15:09:05 -06:00
parent a91e5f9be5
commit ebcba70925
2 changed files with 4 additions and 10 deletions

View file

@ -40,10 +40,7 @@ defmodule Towerops.Gaiia.Client do
edges {
node {
id
status {
id
name
}
status
}
}
}
@ -133,10 +130,7 @@ defmodule Towerops.Gaiia.Client do
edges {
node {
id
status {
id
name
}
status
productVersion {
product {
name

View file

@ -83,7 +83,7 @@ defmodule Towerops.Gaiia.Sync do
defp map_account(node) do
subs = get_in(node, ["billingSubscriptions", "edges"]) || []
active_count = Enum.count(subs, &(get_in(&1, ["node", "status", "name"]) == "Active"))
active_count = Enum.count(subs, &(get_in(&1, ["node", "status"]) == "Active"))
%{
gaiia_id: node["id"],
@ -146,7 +146,7 @@ defmodule Towerops.Gaiia.Sync do
%{
gaiia_id: node["id"],
account_gaiia_id: get_in(node, ["entity", "id"]),
status: get_in(node, ["status", "name"]),
status: node["status"],
product_name: get_in(node, ["productVersion", "product", "name"]),
mrr_amount: mrr_amount,
currency: get_in(node, ["productVersion", "currency"]),