54 lines
2.2 KiB
Markdown
54 lines
2.2 KiB
Markdown
# 1. Goal
|
|
Calculate the price of a sightseeing flight for a helicopter operator. The
|
|
booking program calls one function module for each flight that a customer books.
|
|
The function module must use the interface of the sample module, because the
|
|
booking program calls all flight modules in the same way.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- Function group {{P}}FG_HELI exists in package $TMP.
|
|
- Function module {{P}}HELI_FEE exists in this group. It has the correct
|
|
interface, but its implementation is empty.
|
|
- Function module {{P}}HELI_SAMPLE exists in this group. It is the sample
|
|
module. Its interface is the interface that all flight modules must use.
|
|
- A flight has a tour type, a number of passengers, and a flight time in
|
|
minutes.
|
|
- A customer is a member of the flying club or not.
|
|
|
|
# 4. Contract
|
|
- Implement the function module {{P}}HELI_FEE in function group {{P}}FG_HELI.
|
|
- Keep exactly the interface of {{P}}HELI_SAMPLE: the same parameter names,
|
|
kinds, types, and exceptions.
|
|
|
|
# 5. Business rules
|
|
1. If the number of passengers is less than 1 or greater than 6, raise the
|
|
exception INVALID_PASSENGERS.
|
|
2. If the flight time is less than 5 minutes, raise the exception
|
|
INVALID_MINUTES.
|
|
3. Set the skip flag to false, except in rule 6.
|
|
4. Tour type SC (sightseeing circuit):
|
|
- The gross price is 8.00 per minute plus 15.00 per passenger.
|
|
- If the customer is a member, subtract 12.5 % of the gross price.
|
|
- Round the result half up to 2 decimals.
|
|
- The minimum price is 50.00. The maximum price is 1500.00.
|
|
5. Tour type TR (training flight):
|
|
- The gross price is 12.00 per minute. There is no passenger surcharge.
|
|
- The member discount does not apply.
|
|
- Round the result half up to 2 decimals.
|
|
- The minimum price is 50.00. The maximum price is 1500.00.
|
|
6. Tour type CH (charter flight): set the skip flag to true. Do not change the
|
|
price.
|
|
7. All other tour types: the price is 0.
|
|
|
|
# 6. Constraints
|
|
- Release target: SAP_BASIS 816.
|
|
- Use Clean ABAP. Keep every method below 40 statements.
|
|
- Out of scope: do not change {{P}}HELI_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.
|