21 lines
458 B
Text
21 lines
458 B
Text
|
|
let AlertThreshold = std.contract.custom (
|
||
|
|
fun label =>
|
||
|
|
fun value =>
|
||
|
|
if value >= 0.0 && value <= 1.0 then
|
||
|
|
'Ok value
|
||
|
|
else
|
||
|
|
'Error {
|
||
|
|
message = "Invalid alert_threshold '%{std.to_string value}'.\nValid range: 0.0 - 1.0"
|
||
|
|
}
|
||
|
|
) in
|
||
|
|
|
||
|
|
{
|
||
|
|
RoleBudget = {
|
||
|
|
role | String,
|
||
|
|
monthly_limit_cents | Number,
|
||
|
|
weekly_limit_cents | Number,
|
||
|
|
fallback_provider | String,
|
||
|
|
alert_threshold | AlertThreshold,
|
||
|
|
},
|
||
|
|
}
|