ADT fallback: Accept headers for FUNC; G0189 accepted; regen2 results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
@@ -1,54 +1,53 @@
|
||||
# 1. Goal
|
||||
A customs broker calculates the import duty for a shipment. The broker program
|
||||
calls one function module for each shipment. The function module
|
||||
{{P}}CUSTOMS_DUTY_OLD calculates the duty rate and the duty. Users report
|
||||
several defects. Fix the function module in place. All other behavior stays the
|
||||
same.
|
||||
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_CUST exists in package $TMP.
|
||||
- Function module {{P}}CUSTOMS_DUTY_OLD exists in this group. It is the only
|
||||
function module in the group. Read its source. It defines the duty rates of
|
||||
the goods categories and all the other behavior that must stay the same.
|
||||
- The broker program calls the function module with a customs value, a country
|
||||
of origin and a goods category. The program reads the duty rate and the duty.
|
||||
- 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
|
||||
- Fix the function module {{P}}CUSTOMS_DUTY_OLD in function group {{P}}FG_CUST.
|
||||
- Do not change the interface. The parameters are:
|
||||
- IV_VALUE, importing, decfloat34: the customs value in euro.
|
||||
- IV_COUNTRY, importing, string: the country of origin.
|
||||
- IV_CATEGORY, importing, string: the goods category.
|
||||
- EV_RATE, exporting, decfloat34: the duty rate in percent.
|
||||
- EV_DUTY, exporting, decfloat34: the duty in euro.
|
||||
- The exception INVALID_VALUE stays.
|
||||
- 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
|
||||
1. The duty is rounded half up to 2 decimals. Users report duties with more
|
||||
than 2 decimals, for example 6.185 instead of 6.19.
|
||||
2. The minimum duty is 5.00. The minimum applies only to a shipment that has a
|
||||
duty. A shipment with a duty of zero keeps a duty of zero. Users report that
|
||||
duty-free shipments are charged 5.00.
|
||||
3. A shipment with a preferential origin is duty-free: the duty is 0 and the
|
||||
rate is 0. The preferential origins are Switzerland (CH), Germany (DE),
|
||||
France (FR), Italy (IT) and Spain (ES). Users report that shipments from
|
||||
France, Italy and Spain are charged duty.
|
||||
4. A negative customs value is not valid. Users report that a negative value is
|
||||
accepted and gives a duty. The function module must raise the exception
|
||||
INVALID_VALUE for a negative customs value.
|
||||
5. The duty rates of the goods categories and all other behavior stay the same
|
||||
as they are in {{P}}CUSTOMS_DUTY_OLD today.
|
||||
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: 8.16 (SAP_BASIS 816, ABAP Platform 2025).
|
||||
- Package $TMP. Do not use transports.
|
||||
- Out of scope: do not change other objects.
|
||||
- Clean ABAP. Keep the methods below 40 statements.
|
||||
- Release target: SAP_BASIS 816.
|
||||
- Do not change the function module interface.
|
||||
- Out of scope: no other object.
|
||||
|
||||
# 7. Acceptance
|
||||
- The function module {{P}}CUSTOMS_DUTY_OLD is active and has no syntax error.
|
||||
- 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.
|
||||
|
||||
Reference in New Issue
Block a user