broad-zoo-34077
07/31/2022, 5:50 AMlittle-author-61621
polite-sunset-53335
07/31/2022, 1:26 PMlittle-author-61621
deny[out] {
maxHourlyCost = 100.0
hourlyCost := to_number(input.projects[_].breakdown.resources[_].hourlyCost)
msg := sprintf(
"Hourly cost must be less than $%.2f (actual hourly cost is is $%.2f)",
[maxHourlyCost, hourlyCost],
)
out := {
"msg": msg,
"failed": hourlyCost > maxHourlyCost
}
}
(I’m not an expert in rego, so not quite sure).