44 lines
1.9 KiB
Markdown
44 lines
1.9 KiB
Markdown
# 1. Goal
|
|
A pet boarding kennel charges the owner of a pet for each night that the pet
|
|
stays in the kennel. The booking program calls one event module for each
|
|
booking. The event module must have the same interface as the sample event
|
|
module, because the booking program calls all event modules in the same way.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- Function group {{P}}FG_KENNEL exists in package $TMP.
|
|
- Function module {{P}}KENNEL_SAMPLE exists in this group. It is the sample
|
|
event module. Its interface is the interface that all event modules must use.
|
|
- The booking program passes the pet type, the number of nights and the peak
|
|
season flag. It reads the fee and the deposit.
|
|
|
|
# 4. Contract
|
|
- Create the function module {{P}}KENNEL_FEE in function group {{P}}FG_KENNEL.
|
|
- Use exactly the interface of {{P}}KENNEL_SAMPLE: the same parameter names,
|
|
kinds, types and exceptions.
|
|
|
|
# 5. Business rules
|
|
1. If the number of nights is less than 1, raise the exception INVALID_NIGHTS.
|
|
This rule applies before all other rules.
|
|
2. The nightly rate is 24.90 for pet type DOG, 17.90 for pet type CAT and
|
|
11.90 for pet type RABBIT. For every other pet type the fee is 0 and the
|
|
deposit is 0.
|
|
3. The fee is the nightly rate multiplied by the number of nights.
|
|
4. If the peak season flag is true, increase the fee by 20 %.
|
|
5. If the number of nights is 7 or more, decrease the fee by 10 %. Apply this
|
|
decrease after the peak season increase.
|
|
6. Round the fee half up to 2 decimals.
|
|
7. The deposit is 20 % of the fee, rounded half up to 2 decimals.
|
|
|
|
# 6. Constraints
|
|
- Release target: SAP_BASIS 816.
|
|
- Coding standards: Clean ABAP. Keep every method below 40 statements.
|
|
- Out of scope: do not change {{P}}KENNEL_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.
|