Files
abap-llm/tasks_gen/eval/G0189/spec.md

54 lines
2.0 KiB
Markdown

# 1. Goal
The function module {{P}}THEME_FEE calculates the price of a theme park ticket
order. Users report three defects. Fix the defects in the function module. All
other behavior stays the same.
# 2. Open questions
None.
# 3. Context
- Function group {{P}}FG_THEME exists in package $TMP.
- Function module {{P}}THEME_FEE exists in this group. It is the function
module that the ticket program calls.
- The function module has defects. Read the existing code before you change
it. The existing code holds rules that this specification does not repeat.
# 4. Contract
- Function module {{P}}THEME_FEE in function group {{P}}FG_THEME.
- Parameters:
- iv_visitor_type TYPE string
- iv_tickets TYPE i
- iv_date TYPE d
- ev_unit_price TYPE decfloat34
- ev_total_price TYPE decfloat34
- ev_discount TYPE decfloat34
- Exceptions: invalid_visitor_type, invalid_tickets.
- Do not change the interface.
# 5. Business rules
The function module calculates the price of a theme park ticket order. These
defects are reported:
1. Peak season surcharge: The surcharge must apply only to visit dates in
June, July, or August. Currently the surcharge applies to all dates.
2. Group discount: An order with 20 tickets or more must get a 15 % discount.
Currently an order with exactly 20 tickets gets only 10 %. An order with 10
to 19 tickets must get a 10 % discount. An order with fewer than 10 tickets
must get no discount.
3. Rounding: The discount amount and the total price must be rounded to 2
decimals, half up. Currently they are not rounded. The discount amount is
rounded first. The total price is the gross amount minus the rounded
discount amount, rounded to 2 decimals.
All other behavior stays the same.
# 6. Constraints
- Release target: SAP_BASIS 816.
- Do not change the function module interface.
- Out of scope: no other object.
# 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.