Skip to content

Commit

Permalink
convert old price to negative value
Browse files Browse the repository at this point in the history
  • Loading branch information
ebisbe committed Jul 12, 2024
1 parent a0b94dc commit 7e819c4
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/stepFunctions/itemStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,11 @@ export const itemStream: StepFunctions = {
"S.$": "States.Format('LIST#{}',$.NewImage.listId.S)",
},
},
UpdateExpression:
"SET totalPrice = totalPrice - :oldPrice + :newPrice",
UpdateExpression: "SET totalPrice = totalPrice + :priceDiff",
ExpressionAttributeValues: {
":newPrice": {
"N.$": "$.NewImage.price.N",
},
":oldPrice": {
"N.$": "$.OldImage.price.N",
":priceDiff": {
"N.$":
"States.MathAdd(States.StringToJson(States.Format('-{}', $.OldImage.price.N)),$.NewImage.price.N)",
},
},
},
Expand Down

0 comments on commit 7e819c4

Please sign in to comment.