Files

10 lines
1019 B
Markdown

Create the public final class {{P}}LOYALTY_EVALUATOR in package $TMP. The class has a public constructor without parameters. The class implements the interface {{P}}IF_LOYALTY_RULES. Do not change {{P}}IF_LOYALTY_RULES. Do not add other public methods. Write ABAP Unit tests for the class.
The class must return the tier for a point value. A point value below zero counts as zero. 0 to 999 points is basic. 1000 to 4999 points is silver. 5000 to 19999 points is gold. 20000 points and more is platinum.
The class must return the discount percent for a tier. Basic is 0 percent. Silver is 3 percent. Gold is 7 percent. Platinum is 12 percent. Any other tier value is 0 percent.
The class must return the points to the next tier. A point value below zero counts as zero. Basic needs 1000 points minus the point value. Silver needs 5000 points minus the point value. Gold needs 20000 points minus the point value. Platinum needs 0 points.
The class must be active and have no syntax error. The hidden tests must pass.