Skip to content

Commit 71cf90b

Browse files
authored
fix: use parse_decimal for CEL validation in seed-demo product types (#1273)
The CEL validation environment declares `amount` as StringType (for arbitrary precision decimals). Use parse_decimal(amount) > 0.0 instead of amount > 0 which fails with "no matching overload for _>_ applied to (string, int)". Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>
1 parent bcc8703 commit 71cf90b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cmd/seed-demo/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ var productTypes = []productTypeDef{
256256
normalBalance: referencedatav1.NormalBalance_NORMAL_BALANCE_DEBIT,
257257
behaviorClass: referencedatav1.BehaviorClass_BEHAVIOR_CLASS_INVENTORY,
258258
instrumentCode: "KWH",
259-
validationCEL: "amount > 0",
259+
validationCEL: "parse_decimal(amount) > 0.0",
260260
},
261261
{
262262
code: "ENERGY_TRADING",
@@ -265,7 +265,7 @@ var productTypes = []productTypeDef{
265265
normalBalance: referencedatav1.NormalBalance_NORMAL_BALANCE_DEBIT,
266266
behaviorClass: referencedatav1.BehaviorClass_BEHAVIOR_CLASS_CUSTOMER,
267267
instrumentCode: "GBP",
268-
validationCEL: "amount > 0",
268+
validationCEL: "parse_decimal(amount) > 0.0",
269269
},
270270
}
271271

0 commit comments

Comments
 (0)