2.0 KiB
2.0 KiB
1. Goal
Calculate the price of a car wash order. The checkout program of the car wash calls one function module for each order. The function module also tells the checkout program if the wash tunnel cannot take the vehicle.
2. Open questions
None.
3. Context
- Function group {{P}}FG_WASH exists in package $TMP.
- Function module {{P}}WASH_SAMPLE exists in this group. It is the sample wash module. Its interface is the interface that all wash modules must use.
4. Contract
- Create the function module {{P}}WASH_FEE in function group {{P}}FG_WASH.
- Use exactly the interface of {{P}}WASH_SAMPLE: the same parameter names, kinds, types and exceptions.
5. Business rules
- If the wash program is not BASIC, PLUS or PREMIUM, raise the exception INVALID_PROGRAM.
- If the vehicle category is not S, M or L, raise the exception INVALID_VEHICLE. Check the wash program (rule 1) before the vehicle category.
- Set the reject flag to false, except in rule 5.
- Base price of the wash program: BASIC 8.50, PLUS 12.50, PREMIUM 18.50.
- If the vehicle category is L and the wash program is BASIC, the wash tunnel cannot take the vehicle. Set the reject flag to true and set the price to 0.00. Rules 6 to 8 do not apply.
- Vehicle surcharge: category S 0.00, category M 2.50, category L 5.50. Add the surcharge to the base price.
- Extra wax: add 3.50 to the price. For the wash program PREMIUM the wax is included in the price, so add nothing.
- Fleet discount: if the fleet flag is true, the customer pays 85 % of the price after rules 4 to 7, rounded half up to 2 decimals. All prices are in euro.
6. Constraints
- Release target: SAP_BASIS 816 (ABAP Platform 2025).
- Coding standards: Clean ABAP. Keep every method below 40 statements. Do not create ATC findings of priority 1 or 2.
- Out of scope: do not change {{P}}WASH_SAMPLE.
7. Acceptance
- The function module is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests for the function module in a global test class.