Created
August 11, 2020 02:59
-
-
Save ashkrit/5213fc7898eb15f72f69cef263558788 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
decisionSystem("FX Transaction", tradeSchema, s -> { | |
s.rule("High Transfer discount", condition -> { | |
condition | |
.gt("amount", 1000d) | |
.eq("source", "SGD") | |
.eq("target", "INR") | |
.action((rule, row) -> row.setDiscount(2.0d)); | |
}); | |
s.rule("less than minimum", condition -> { | |
condition | |
.lt("amount", 1000d) | |
.action((rule, row) -> row.setDiscount(-1.0d)); | |
}); | |
s.rule("limited time period", conditions -> { | |
conditions | |
.between("date", 20200805, 20200831) | |
.action((rule, row) -> row.setDiscount(5.0d)); | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment