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,16 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Tour load'
define view entity {{P}}I_TOUR_LOAD
as select from {{p}}tour as tour
inner join {{p}}parcel as parcel on parcel.tour_id = tour.tour_id
{
key tour.tour_id as tour_id,
tour.driver as driver,
tour.depot as depot,
count( * ) as parcel_count,
sum( parcel.weight ) as total_weight
}
group by
tour.tour_id,
tour.driver,
tour.depot

View File

@@ -0,0 +1,52 @@
CLASS {{p}}t31_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 one_row_for_multi_zone FOR TESTING.
METHODS total_of_two_parcels FOR TESTING.
ENDCLASS.
CLASS {{p}}t31_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_TOUR_LOAD' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
go_env->clear_doubles( ).
ENDMETHOD.
METHOD one_row_for_multi_zone.
DATA lt_tour TYPE STANDARD TABLE OF {{p}}tour WITH EMPTY KEY.
DATA lt_parcel TYPE STANDARD TABLE OF {{p}}parcel WITH EMPTY KEY.
lt_tour = VALUE #( ( tour_id = 'A' driver = 'DA' depot = 'N01' ) ).
lt_parcel = VALUE #( ( tour_id = 'A' parcel_no = 1 dest_zone = 'A' weight = '1.000' )
( tour_id = 'A' parcel_no = 2 dest_zone = 'B' weight = '2.000' ) ).
go_env->insert_test_data( lt_tour ).
go_env->insert_test_data( lt_parcel ).
SELECT COUNT(*) FROM {{p}}i_tour_load INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rows ).
ENDMETHOD.
METHOD total_of_two_parcels.
DATA lt_tour TYPE STANDARD TABLE OF {{p}}tour WITH EMPTY KEY.
DATA lt_parcel TYPE STANDARD TABLE OF {{p}}parcel WITH EMPTY KEY.
lt_tour = VALUE #( ( tour_id = 'B' driver = 'DB' depot = 'S02' ) ).
lt_parcel = VALUE #( ( tour_id = 'B' parcel_no = 1 dest_zone = 'A' weight = '1.500' )
( tour_id = 'B' parcel_no = 2 dest_zone = 'A' weight = '2.500' ) ).
go_env->insert_test_data( lt_tour ).
go_env->insert_test_data( lt_parcel ).
SELECT SINGLE parcel_count, total_weight FROM {{p}}i_tour_load WHERE tour_id = 'B'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_row-parcel_count ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '4.000' )
act = CONV decfloat34( ls_row-total_weight ) ).
ENDMETHOD.
ENDCLASS.