Step F first pass: 81/92 accepted; budget floor 60 calls; rejected slots moved for regeneration

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 12:10:52 +02:00
parent d3250acfb8
commit 39769afce8
741 changed files with 40573 additions and 317 deletions

View File

@@ -0,0 +1,14 @@
{
"id": "G0177",
"pool": "eval",
"object_type": "DDLS",
"category": "H",
"attempts": [
{
"stage": "validate",
"oracle": 100,
"null": 30
}
],
"accepted": true
}

View File

@@ -0,0 +1,40 @@
CLASS {{p}}event_revenue_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 confirmed_only FOR TESTING.
ENDCLASS.
CLASS {{p}}event_revenue_test IMPLEMENTATION.
METHOD class_setup.
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_EVENT_REVENUE' ).
ENDMETHOD.
METHOD class_teardown.
go_env->destroy( ).
ENDMETHOD.
METHOD setup.
go_env->clear_doubles( ).
ENDMETHOD.
METHOD confirmed_only.
DATA lt_event TYPE STANDARD TABLE OF {{p}}event WITH EMPTY KEY.
DATA lt_booking TYPE STANDARD TABLE OF {{p}}booking WITH EMPTY KEY.
lt_event = VALUE #( ( event_id = 'E1' event_date = '20250101' room = 'A1' ) ).
lt_booking = VALUE #(
( event_id = 'E1' booking_no = 1 guests = 10 fee = '100.00' status = 'C' )
( event_id = 'E1' booking_no = 2 guests = 5 fee = '50.00' status = 'X' )
).
go_env->insert_test_data( lt_event ).
go_env->insert_test_data( lt_booking ).
SELECT SINGLE booking_count, total_guests, total_fee FROM {{p}}i_event_revenue
WHERE event_id = 'E1' INTO @DATA(ls_rev).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_rev-booking_count ).
cl_abap_unit_assert=>assert_equals( exp = 10 act = ls_rev-total_guests ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '100.00' ) act = CONV decfloat34( ls_rev-total_fee ) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,16 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Event revenue'
define view entity {{P}}I_EVENT_REVENUE
as select from {{p}}event as ev
left outer join {{p}}booking as bk on bk.event_id = ev.event_id
and bk.status = 'C'
{
key ev.event_id as event_id,
ev.event_date as event_date,
count( bk.booking_no ) as booking_count,
sum( bk.guests ) as total_guests,
sum( bk.fee ) as total_fee
}
group by
ev.event_id,
ev.event_date

View File

@@ -0,0 +1,13 @@
@EndUserText.label : 'Event booking'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}booking {
key client : abap.clnt not null;
key event_id : abap.char(10) not null;
key booking_no : abap.int4 not null;
guests : abap.int4;
fee : abap.dec(15,2);
status : abap.char(1);
}

View File

@@ -0,0 +1,11 @@
@EndUserText.label : 'Event header'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table {{p}}event {
key client : abap.clnt not null;
key event_id : abap.char(10) not null;
event_date : abap.dats;
room : abap.char(4);
}

View File

@@ -0,0 +1,23 @@
CLASS {{p}}seed_event DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
ENDCLASS.
CLASS {{p}}seed_event IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
DELETE FROM {{p}}event.
DELETE FROM {{p}}booking.
INSERT {{p}}event FROM TABLE @( VALUE #(
( event_id = 'E1' event_date = '20250101' room = 'A1' )
( event_id = 'E2' event_date = '20250102' room = 'A2' )
( event_id = 'E3' event_date = '20250103' room = 'B1' )
) ).
INSERT {{p}}booking FROM TABLE @( VALUE #(
( event_id = 'E1' booking_no = 1 guests = 10 fee = '100.00' status = 'C' )
( event_id = 'E1' booking_no = 2 guests = 5 fee = '50.00' status = 'C' )
( event_id = 'E2' booking_no = 1 guests = 20 fee = '200.00' status = 'C' )
( event_id = 'E2' booking_no = 2 guests = 15 fee = '150.00' status = 'X' )
( event_id = 'E3' booking_no = 1 guests = 8 fee = '80.00' status = 'X' )
) ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,30 @@
# 1. Goal
Show the revenue and the number of guests for each event in a conference centre. A report and an OData service will read the totals, so the calculation must be in the database, in a CDS view.
# 2. Open questions
None.
# 3. Context
- Table {{P}}EVENT (event header), package $TMP. Key: EVENT_ID (CHAR 10). Fields: EVENT_DATE (DATS), ROOM (CHAR 4).
- Table {{P}}BOOKING (event booking), package $TMP. Key: EVENT_ID (CHAR 10), BOOKING_NO (INT4). Fields: GUESTS (INT4), FEE (DEC 15,2), STATUS (CHAR 1).
# 4. Contract
- Create the CDS view entity {{P}}I_EVENT_REVENUE in package $TMP.
- Elements, with these names: EVENT_ID (key), EVENT_DATE, BOOKING_COUNT, TOTAL_GUESTS, TOTAL_FEE.
- No authorization check (#NOT_REQUIRED).
# 5. Business rules
1. Show one row for each event.
2. BOOKING_COUNT is the number of bookings of the event.
3. TOTAL_GUESTS is the sum of GUESTS of all bookings of the event.
4. TOTAL_FEE is the sum of FEE of all bookings of the event.
5. Only include bookings with STATUS = 'C' (confirmed).
6. Include all bookings, also cancelled ones, because the revenue must show the original amount.
# 6. Constraints
- Release target: 8.16.
- Out of scope: do not change {{P}}EVENT and {{P}}BOOKING.
# 7. Acceptance
- The view is active and has no syntax error.
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.

View File

@@ -0,0 +1,83 @@
{
"id": "G0177",
"category": "H",
"object_type": "DDLS",
"difficulty": 2,
"release_target": "v816",
"expected_outcome": "stop",
"expected_gap": {
"description": "Business rules 5 and 6 contradict: rule 5 says only confirmed bookings, rule 6 says all bookings including cancelled ones.",
"keywords": [
[
"contradiction",
"rules"
],
[
"contradict",
"rules"
],
[
"confirmed",
"cancelled"
]
]
},
"budget": {
"max_tool_calls": 20,
"max_activations": 5
},
"seed": [
{
"type": "TABL",
"name": "{{P}}EVENT",
"file": "seed/event.tabl.asabap",
"description": "Event header"
},
{
"type": "TABL",
"name": "{{P}}BOOKING",
"file": "seed/booking.tabl.asabap",
"description": "Event booking"
},
{
"type": "CLAS",
"name": "{{P}}SEED_EVENT",
"file": "seed/seed_event.clas.abap",
"description": "Seed data for event and booking",
"run": true
}
],
"contract": [
{
"type": "DDLS",
"name": "{{P}}I_EVENT_REVENUE",
"fields": [
"EVENT_ID",
"EVENT_DATE",
"BOOKING_COUNT",
"TOTAL_GUESTS",
"TOTAL_FEE"
]
}
],
"out_of_scope": [
"{{P}}EVENT",
"{{P}}BOOKING"
],
"hidden_tests": [],
"reference": [
{
"type": "DDLS",
"name": "{{P}}I_EVENT_REVENUE",
"file": "reference/i_event_revenue.ddls.asddls",
"description": "Event revenue (intended)"
},
{
"type": "CLAS",
"name": "{{P}}EVENT_REVENUE_TEST",
"file": "reference/event_revenue_test.clas.abap",
"description": "Own tests for event revenue"
}
],
"craft_checks": []
}