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

@@ -0,0 +1,47 @@
FUNCTION {{p}}bowl_fee_old
IMPORTING
iv_lanes TYPE i
iv_minutes TYPE i
iv_players TYPE i
iv_day TYPE string
iv_start TYPE t
iv_member TYPE abap_bool
EXPORTING
ev_fee TYPE decfloat34
EXCEPTIONS
invalid_input.
CONSTANTS c_half_hour_minutes TYPE i VALUE 30.
CONSTANTS c_lane_price TYPE decfloat34 VALUE '6.00'.
CONSTANTS c_shoe_price TYPE decfloat34 VALUE '2.50'.
CONSTANTS c_peak_start TYPE t VALUE '180000'.
CONSTANTS c_peak_end TYPE t VALUE '220000'.
CONSTANTS c_peak_factor TYPE decfloat34 VALUE '1.2'.
CONSTANTS c_weekend_factor TYPE decfloat34 VALUE '1.15'.
CONSTANTS c_member_factor TYPE decfloat34 VALUE '0.9'.
CONSTANTS c_member_min_fee TYPE decfloat34 VALUE '20.00'.
IF iv_lanes < 1 OR iv_minutes < 1 OR iv_players < 0.
RAISE invalid_input.
ENDIF.
DATA(lv_half_hours) = ( iv_minutes + c_half_hour_minutes - 1 ) DIV c_half_hour_minutes.
DATA(lv_lane_fee) = iv_lanes * lv_half_hours * c_lane_price.
IF iv_start >= c_peak_start AND iv_start < c_peak_end.
lv_lane_fee = lv_lane_fee * c_peak_factor.
ENDIF.
IF iv_day = 'SAT' OR iv_day = 'SUN'.
lv_lane_fee = lv_lane_fee * c_weekend_factor.
ENDIF.
DATA(lv_total) = lv_lane_fee + iv_players * c_shoe_price.
IF iv_member = abap_true AND lv_total >= c_member_min_fee.
lv_total = lv_total * c_member_factor.
ENDIF.
ev_fee = round( val = lv_total dec = 2 mode = cl_abap_math=>round_half_up ).
ENDFUNCTION.

View File

@@ -1,71 +0,0 @@
CLASS {{p}}crane_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS fee_for
IMPORTING iv_type TYPE string
iv_hours TYPE decfloat34
iv_km TYPE i
iv_weekend TYPE abap_bool
iv_customer TYPE string
RETURNING VALUE(rv_total) TYPE decfloat34.
METHODS small_crane FOR TESTING.
METHODS weekend_and_gold FOR TESTING.
METHODS travel_cap FOR TESTING.
METHODS invalid_input FOR TESTING.
ENDCLASS.
CLASS {{p}}crane_test IMPLEMENTATION.
METHOD fee_for.
CALL FUNCTION '{{P}}CRANE_FEE_OLD'
EXPORTING
iv_crane_type = iv_type
iv_hours = iv_hours
iv_distance_km = iv_km
iv_weekend = iv_weekend
iv_customer = iv_customer
IMPORTING
ev_total = rv_total
EXCEPTIONS
invalid_crane_type = 1
invalid_hours = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
ENDMETHOD.
METHOD small_crane.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( 230 )
act = fee_for( iv_type = 'SM' iv_hours = 2 iv_km = 0 iv_weekend = abap_false iv_customer = 'STD' ) ).
ENDMETHOD.
METHOD weekend_and_gold.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '655.88' )
act = fee_for( iv_type = 'MD' iv_hours = 3 iv_km = 20 iv_weekend = abap_true iv_customer = 'GOLD' ) ).
ENDMETHOD.
METHOD travel_cap.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( 240 )
act = fee_for( iv_type = 'SM' iv_hours = 1 iv_km = 200 iv_weekend = abap_false iv_customer = 'STD' ) ).
ENDMETHOD.
METHOD invalid_input.
DATA lv_total TYPE decfloat34.
CALL FUNCTION '{{P}}CRANE_FEE_OLD'
EXPORTING
iv_crane_type = 'XX'
iv_hours = 1
iv_distance_km = 0
iv_weekend = abap_false
iv_customer = 'STD'
IMPORTING
ev_total = lv_total
EXCEPTIONS
invalid_crane_type = 1
invalid_hours = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,72 @@
CLASS {{p}}t_bowl_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS fee_for
IMPORTING
iv_lanes TYPE i
iv_minutes TYPE i
iv_players TYPE i
iv_day TYPE string
iv_start TYPE t
iv_member TYPE abap_bool
RETURNING VALUE(rv_fee) TYPE decfloat34.
METHODS lane_fee FOR TESTING.
METHODS surcharges FOR TESTING.
METHODS member_discount FOR TESTING.
METHODS invalid_input FOR TESTING.
ENDCLASS.
CLASS {{p}}t_bowl_test IMPLEMENTATION.
METHOD fee_for.
CALL FUNCTION '{{P}}BOWL_FEE_OLD'
EXPORTING
iv_lanes = iv_lanes
iv_minutes = iv_minutes
iv_players = iv_players
iv_day = iv_day
iv_start = iv_start
iv_member = iv_member
IMPORTING
ev_fee = rv_fee
EXCEPTIONS
invalid_input = 1
OTHERS = 2.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
ENDMETHOD.
METHOD lane_fee.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '12.00' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 0
iv_day = 'WED' iv_start = '140000' iv_member = abap_false ) ).
ENDMETHOD.
METHOD surcharges.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '14.40' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 0
iv_day = 'WED' iv_start = '190000' iv_member = abap_false ) ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '13.80' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 0
iv_day = 'SAT' iv_start = '140000' iv_member = abap_false ) ).
ENDMETHOD.
METHOD member_discount.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '30.60' )
act = fee_for( iv_lanes = 2 iv_minutes = 60 iv_players = 4
iv_day = 'WED' iv_start = '140000' iv_member = abap_true ) ).
ENDMETHOD.
METHOD invalid_input.
DATA lv_fee TYPE decfloat34.
CALL FUNCTION '{{P}}BOWL_FEE_OLD'
EXPORTING iv_lanes = 0 iv_minutes = 60 iv_players = 0
iv_day = 'WED' iv_start = '140000' iv_member = abap_false
IMPORTING ev_fee = lv_fee
EXCEPTIONS invalid_input = 1 OTHERS = 2.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
ENDMETHOD.
ENDCLASS.