Fix usage calculations

This commit is contained in:
Andrew Kingston 2025-01-08 09:26:44 +00:00
parent 4d0f69556c
commit 0d1c86777c
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -227,7 +227,7 @@ class LicensingStore extends BudiStore<LicensingState> {
MonthlyQuotaName.AUTOMATIONS,
].reduce((acc: MonthlyMetrics, key) => {
const limit = license.quotas.usage.monthly[key].value
const used = (usage.monthly.current?.[key] || 0 / limit) * 100
const used = ((usage.monthly.current?.[key] || 0) / limit) * 100
acc[key] = limit > -1 ? Math.floor(used) : -1
return acc
}, {})
@ -236,7 +236,7 @@ class LicensingStore extends BudiStore<LicensingState> {
const staticMetrics = [StaticQuotaName.APPS, StaticQuotaName.ROWS].reduce(
(acc: StaticMetrics, key) => {
const limit = license.quotas.usage.static[key].value
const used = (usage.usageQuota[key] || 0 / limit) * 100
const used = ((usage.usageQuota[key] || 0) / limit) * 100
acc[key] = limit > -1 ? Math.floor(used) : -1
return acc
},