rego4k debugger
Query
decision := data.orders.approval.decision
Write a policy, an input and a query. Then click Debug.
package lib.money # True if the amount is not over the limit. within_limit(amount, limit) if amount <= limit # The amount with the tax of the region, in cents. with_tax(amount, region) := round((amount * (1 + data.orders.tax[region])) * 100) # The amount in cents. cents(amount) := round(amount * 100) # True if the company accepts the currency. accepted_currency(code) if code in {"EUR", "GBP", "USD"}
Input (JSON)
{ "order": { "amount": 100 }, "user": { "department": "sales", "roles": [ "buyer" ] } }