Pipeline controller: plan 2 (hard +, error +50 %), backlog throttle, 2 trajectory workers, stop rules, summaries every 50; budget reserve

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 13:35:54 +02:00
parent 1c4667a0fc
commit 13360292dd
781 changed files with 50211 additions and 22 deletions

View File

@@ -0,0 +1,89 @@
CLASS {{p}}mkt_fee_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS fee_for
IMPORTING iv_size TYPE string
iv_days TYPE i
iv_power TYPE abap_bool
RETURNING VALUE(rv_fee) TYPE decfloat34.
METHODS daily_fee_by_size FOR TESTING.
METHODS power_surcharge FOR TESTING.
METHODS reduction_from_five_days FOR TESTING.
METHODS reduction_is_rounded FOR TESTING.
METHODS invalid_days FOR TESTING.
METHODS invalid_size FOR TESTING.
ENDCLASS.
CLASS {{p}}mkt_fee_test IMPLEMENTATION.
METHOD fee_for.
CALL FUNCTION '{{P}}MKT_STALL_FEE'
EXPORTING
iv_stall_size = iv_size
iv_days = iv_days
iv_power = iv_power
IMPORTING
ev_fee = rv_fee
EXCEPTIONS
invalid_days = 1
invalid_size = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
ENDMETHOD.
METHOD daily_fee_by_size.
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '12.00' )
act = fee_for( iv_size = 'S' iv_days = 1 iv_power = abap_false ) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '20.00' )
act = fee_for( iv_size = 'M' iv_days = 1 iv_power = abap_false ) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '35.00' )
act = fee_for( iv_size = 'L' iv_days = 1 iv_power = abap_false ) ).
ENDMETHOD.
METHOD power_surcharge.
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '45.00' )
act = fee_for( iv_size = 'M' iv_days = 2 iv_power = abap_true ) ).
ENDMETHOD.
METHOD reduction_from_five_days.
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '80.00' )
act = fee_for( iv_size = 'M' iv_days = 4 iv_power = abap_false ) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '51.00' )
act = fee_for( iv_size = 'S' iv_days = 5 iv_power = abap_false ) ).
ENDMETHOD.
METHOD reduction_is_rounded.
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '61.62' )
act = fee_for( iv_size = 'S' iv_days = 5 iv_power = abap_true ) ).
ENDMETHOD.
METHOD invalid_days.
DATA lv_fee TYPE decfloat34.
CALL FUNCTION '{{P}}MKT_STALL_FEE'
EXPORTING
iv_stall_size = 'S'
iv_days = 0
iv_power = abap_false
IMPORTING
ev_fee = lv_fee
EXCEPTIONS
invalid_days = 1
OTHERS = 2.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
ENDMETHOD.
METHOD invalid_size.
DATA lv_fee TYPE decfloat34.
CALL FUNCTION '{{P}}MKT_STALL_FEE'
EXPORTING
iv_stall_size = 'Z'
iv_days = 2
iv_power = abap_false
IMPORTING
ev_fee = lv_fee
EXCEPTIONS
invalid_size = 1
OTHERS = 2.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
ENDMETHOD.
ENDCLASS.