Stage 2 summary at 50 accepted trajectories

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 18:02:52 +02:00
parent 332fb4601d
commit 5bcd1bf9cd
1230 changed files with 77563 additions and 33 deletions

View File

@@ -0,0 +1,14 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Spirit output per still'
define view entity {{P}}I_STILL_OUTPUT
as select from {{p}}runlog
{
key still_id as still_id,
count( * ) as runs,
sum( wash_litre ) as wash_l,
sum( spirit_litre ) as spirit_l,
count( distinct cask_no ) as casks,
max( run_date ) as last_run
}
where spirit_litre > 0
group by still_id

View File

@@ -0,0 +1,43 @@
CLASS {{p}}runlog_out_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
CLASS-METHODS class_setup.
CLASS-METHODS class_teardown.
METHODS setup.
METHODS output_of_one_still FOR TESTING.
ENDCLASS.
CLASS {{p}}runlog_out_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_STILL_OUTPUT' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_runlog TYPE STANDARD TABLE OF {{p}}runlog WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_runlog = VALUE #(
( run_id = 'X1' still_id = 'STILL-X' run_date = '20240501'
wash_litre = '400.0' spirit_litre = '50.0' strength_pct = '66.00' cask_no = 'K1' )
( run_id = 'X2' still_id = 'STILL-X' run_date = '20240520'
wash_litre = '600.0' spirit_litre = '80.0' strength_pct = '67.00' cask_no = 'K1' ) ).
go_env->insert_test_data( lt_runlog ).
ENDMETHOD.
METHOD output_of_one_still.
SELECT SINGLE runs, wash_l, spirit_l, casks, last_run
FROM {{p}}i_still_output WHERE still_id = 'STILL-X' INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_row-runs ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '1000.0' )
act = CONV decfloat34( ls_row-wash_l ) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '130.0' )
act = CONV decfloat34( ls_row-spirit_l ) ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_row-casks ).
cl_abap_unit_assert=>assert_equals( exp = CONV dats( '20240520' ) act = ls_row-last_run ).
ENDMETHOD.
ENDCLASS.