feat: overage allowed control

This commit is contained in:
John Yeo
2026-03-30 15:25:40 +01:00
parent 1bd2344c9b
commit 596122b3ce
34 changed files with 1135 additions and 41 deletions

View File

@@ -18,7 +18,8 @@
processors?: object | null,
auto_topups?: array | null,
spend_limits?: array | null,
usage_alerts?: array | null
usage_alerts?: array | null,
overage_allowed?: array | null
}
}
@@ -121,4 +122,13 @@ if updates.usage_alerts ~= nil then
table.insert(updated_fields, 'usage_alerts')
end
if updates.overage_allowed ~= nil then
if is_nil(updates.overage_allowed) then
redis.call('JSON.SET', cache_key, '$.overage_allowed', 'null')
else
redis.call('JSON.SET', cache_key, '$.overage_allowed', cjson.encode(updates.overage_allowed))
end
table.insert(updated_fields, 'overage_allowed')
end
return cjson.encode({ success = true, updated_fields = updated_fields })