Snapshot: new training tasks (balanced generation), docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 22:08:59 +02:00
parent eb13453097
commit 6984fc7917
572 changed files with 30024 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Stargazing nights of the observatory'
define view entity {{P}}I_STAR_NIGHT
as select from {{p}}night as night
inner join {{p}}dome as dome on dome.dome_id = night.dome_id
inner join {{p}}scope as scope on scope.scope_id = night.scope_id
{
key night.night_id as night_id,
night.dome_id as dome_id,
dome.dome_name as dome_name,
dome.city as dome_city,
night.scope_id as scope_id,
scope.scope_name as scope_name,
scope.aperture_mm as aperture_mm,
night.visitors as visitors,
night.night_date as night_date,
dome.capacity - night.visitors as free_seats
}

View File

@@ -0,0 +1,51 @@
CLASS {{p}}t61_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 reads_master_data_once FOR TESTING.
METHODS drops_night_without_dome FOR TESTING.
ENDCLASS.
CLASS {{p}}t61_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_STAR_NIGHT' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
DATA lt_dome TYPE STANDARD TABLE OF {{p}}dome WITH EMPTY KEY.
DATA lt_scope TYPE STANDARD TABLE OF {{p}}scope WITH EMPTY KEY.
DATA lt_night TYPE STANDARD TABLE OF {{p}}night WITH EMPTY KEY.
go_env->clear_doubles( ).
lt_dome = VALUE #( ( dome_id = 'D1' dome_name = 'Main Dome' city = 'NORTH' capacity = 90 ) ).
lt_scope = VALUE #( ( scope_id = 'S1' scope_name = 'Reflector' aperture_mm = 300 mount_kind = 'EQUATORIAL' ) ).
lt_night = VALUE #( ( night_id = 'A1' dome_id = 'D1' scope_id = 'S1' visitors = 60 night_date = '20250701' )
( night_id = 'A2' dome_id = 'DX' scope_id = 'S1' visitors = 10 night_date = '20250702' ) ).
go_env->insert_test_data( lt_dome ).
go_env->insert_test_data( lt_scope ).
go_env->insert_test_data( lt_night ).
ENDMETHOD.
METHOD reads_master_data_once.
SELECT SINGLE dome_name, dome_city, scope_name, free_seats
FROM {{p}}i_star_night
WHERE night_id = 'A1'
INTO @DATA(ls_row).
cl_abap_unit_assert=>assert_equals( exp = 'Main Dome' act = ls_row-dome_name ).
cl_abap_unit_assert=>assert_equals( exp = 'NORTH' act = ls_row-dome_city ).
cl_abap_unit_assert=>assert_equals( exp = 'Reflector' act = ls_row-scope_name ).
cl_abap_unit_assert=>assert_equals( exp = 30 act = ls_row-free_seats ).
ENDMETHOD.
METHOD drops_night_without_dome.
SELECT COUNT(*) FROM {{p}}i_star_night INTO @DATA(lv_rows).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rows ).
ENDMETHOD.
ENDCLASS.