Restore faz1/yol-haritasi docs (overwritten by copy); stage1 docs; G0174 new gap; stage1 25-task subset

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
Kral
2026-10-03 17:33:55 +02:00
parent 01e99158a9
commit 65322f27ff
44 changed files with 2137 additions and 855 deletions

View File

@@ -1,48 +1,53 @@
# 1. Goal
Refactor the legacy function module {{P}}CRANE_FEE_OLD in function group
{{P}}FG_CRANE. The function module calculates the fee of a crane hire job. The
refactoring must improve the quality of the code. The behavior stays the same.
The name and the public interface stay the same.
Refactor the legacy function module {{P}}BOWL_FEE_OLD in function group
{{P}}FG_BOWL. The function module calculates the fee of a booking of bowling
lanes at a bowling centre. The booking program calls the function module for
each booking. The code is old, hard to read, and hard to maintain. Refactor the
code in place. Read the legacy code. The legacy code contains the calculation
rules. The behaviour stays the same.
# 2. Open questions
None.
# 3. Context
- Function group {{P}}FG_CRANE exists in package $TMP.
- Function module {{P}}CRANE_FEE_OLD exists in this group. It is the legacy
implementation of the fee calculation. Read its source. The source defines
the fee rules of the crane hire company.
- A crane hire company uses the function module to price jobs. The dispatcher
enters the crane type, the number of hours, the distance in kilometres,
whether the job is on a weekend, and the customer category. The function
module returns the base fee, the travel fee, the surcharge, the discount, and
the total fee.
- Function group {{P}}FG_BOWL exists in package $TMP.
- Function module {{P}}BOWL_FEE_OLD exists in this group. It contains the
legacy code.
- The booking program calls {{P}}BOWL_FEE_OLD. The booking program also calls
{{P}}BOWL_INFO.
# 4. Contract
- Refactor the function module {{P}}CRANE_FEE_OLD in function group
{{P}}FG_CRANE in place.
- Keep the name and the public interface exactly as they are.
- The interface is:
- Importing: iv_crane_type TYPE string, iv_hours TYPE decfloat34,
iv_distance_km TYPE i, iv_weekend TYPE abap_bool, iv_customer TYPE string.
- Exporting: ev_base_fee TYPE decfloat34, ev_travel_fee TYPE decfloat34,
ev_surcharge TYPE decfloat34, ev_discount TYPE decfloat34,
ev_total TYPE decfloat34.
- Exceptions: invalid_crane_type, invalid_hours.
- Refactor the function module {{P}}BOWL_FEE_OLD in function group
{{P}}FG_BOWL.
- The name, the parameter names, the parameter kinds, the parameter types, and
the exceptions stay exactly as they are:
- IMPORTING iv_lanes TYPE i
- IMPORTING iv_minutes TYPE i
- IMPORTING iv_players TYPE i
- IMPORTING iv_day TYPE string
- IMPORTING iv_start TYPE t
- IMPORTING iv_member TYPE abap_bool
- EXPORTING ev_fee TYPE decfloat34
- EXCEPTIONS invalid_input
# 5. Business rules
The behavior of the current implementation is the specification. The
refactored function module must return exactly the same values as the current
implementation for every input. Read the legacy source carefully to learn the
rules. Do not change the behavior.
1. The legacy code defines the calculation. Read the legacy code. The result
stays the same for every input combination.
2. The code follows Clean ABAP: small units with one task, no deep nesting, no
magic numbers, and meaningful names.
3. No unit has more than 40 statements.
4. The code has no syntax error and no ATC finding of priority 1 or 2.
# 6. Constraints
- Release target: 7.58.
- Coding standards: Clean ABAP. Methods must be shorter than 40 statements.
Pass large parameters by reference.
- Out of scope: do not change the function group {{P}}FG_CRANE.
- Release target: SAP_BASIS 816 (ABAP Platform 2025).
- Package $TMP. Do not use transports.
- The refactored code stays in the body of {{P}}BOWL_FEE_OLD, between the
FUNCTION statement and the ENDFUNCTION statement. Do not add local classes
after ENDFUNCTION; the source tooling does not activate them.
- Out of scope: do not change {{P}}BOWL_INFO. Do not change the interface of
{{P}}BOWL_FEE_OLD.
# 7. Acceptance
- The function module {{P}}CRANE_FEE_OLD is active and has no syntax error.
- The function module {{P}}BOWL_FEE_OLD is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests for the function module in a global test class.