Files
abap-llm/tasks_gen/eval/G0023/seed/freight_legacy.clas.abap
Kral 32f03fcad4 Hard batch G0022-G0026: 5/5 accepted; budget floor, CDS checks, mutation check
- generator: budget floor (2x oracle activations, 3x calls), static checks for CDS
  $parameters and UNION annotation
- harness/mutation.py: deterministic mutants of the reference; hidden tests must fail
- G0022 revalidated with harness fixes: oracle 100, null 0
- results in docs/faz1-tasarim.md 11f

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 05:16:30 +02:00

62 lines
1.8 KiB
ABAP

CLASS {{p}}freight_legacy DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES {{p}}if_freight_calc.
ENDCLASS.
CLASS {{p}}freight_legacy IMPLEMENTATION.
METHOD {{p}}if_freight_calc~calculate.
DATA: lv_base TYPE {{p}}if_freight_calc=>ty_amount,
lv_per_kg TYPE {{p}}if_freight_calc=>ty_amount,
lv_minimum TYPE {{p}}if_freight_calc=>ty_amount,
lv_surcharge TYPE p LENGTH 4 DECIMALS 3,
lv_charge TYPE {{p}}if_freight_calc=>ty_amount,
lv_freight TYPE {{p}}if_freight_calc=>ty_amount,
lv_fee TYPE {{p}}if_freight_calc=>ty_amount,
lv_total TYPE {{p}}if_freight_calc=>ty_amount.
CASE iv_zone.
WHEN 'DE'.
lv_base = '12.50'.
lv_per_kg = '0.85'.
lv_minimum = '25.00'.
lv_surcharge = '0.065'.
WHEN 'FR'.
lv_base = '15.00'.
lv_per_kg = '1.10'.
lv_minimum = '30.00'.
lv_surcharge = '0.075'.
WHEN 'NL'.
lv_base = '10.00'.
lv_per_kg = '0.75'.
lv_minimum = '20.00'.
lv_surcharge = '0.055'.
WHEN 'US'.
lv_base = '20.00'.
lv_per_kg = '1.40'.
lv_minimum = '45.00'.
lv_surcharge = '0.085'.
WHEN 'CN'.
lv_base = '25.00'.
lv_per_kg = '1.25'.
lv_minimum = '50.00'.
lv_surcharge = '0.095'.
WHEN OTHERS.
rv_cost = 0.
RETURN.
ENDCASE.
lv_charge = lv_per_kg * iv_weight.
lv_freight = lv_base + lv_charge.
IF lv_freight < lv_minimum.
lv_freight = lv_minimum.
ENDIF.
lv_fee = lv_freight * lv_surcharge.
lv_total = lv_freight + lv_fee.
IF iv_weight > '1000.000'.
lv_total = lv_total * '0.95'.
ENDIF.
rv_cost = lv_total.
ENDMETHOD.
ENDCLASS.