Generator: pilot analysis and fixes; G0002-G0021 tasks; handover notes merged
- Static bundle checks (name length, seed type, reserved words, contract test classes, testclasses_file), local abaplint parser check before SAP, max_tokens, robust JSON parse - Runner: G2 for CDS views with parameters, contract_check detail in report - G0020 and G0013 fixed by review and revalidated (oracle 100, null 0) - Pilot results in docs/faz1-tasarim.md 11e; handover notes merged into CLAUDE.md and docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
53
tasks_gen/eval/G0009/seed/shipping_cost_legacy.clas.abap
Normal file
53
tasks_gen/eval/G0009/seed/shipping_cost_legacy.clas.abap
Normal file
@@ -0,0 +1,53 @@
|
||||
CLASS {{p}}shipping_cost_legacy DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
INTERFACES {{p}}if_shipping_cost.
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS base_rate
|
||||
IMPORTING iv_weight TYPE {{p}}if_shipping_cost=>ty_weight
|
||||
RETURNING VALUE(rv_rate) TYPE {{p}}if_shipping_cost=>ty_amount.
|
||||
|
||||
METHODS express_surcharge
|
||||
IMPORTING iv_rate TYPE {{p}}if_shipping_cost=>ty_amount
|
||||
RETURNING VALUE(rv_surcharge) TYPE {{p}}if_shipping_cost=>ty_amount.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}shipping_cost_legacy IMPLEMENTATION.
|
||||
METHOD {{p}}if_shipping_cost~calculate.
|
||||
IF iv_weight <= 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
rv_cost = base_rate( iv_weight ).
|
||||
|
||||
IF rv_cost < {{p}}if_shipping_cost=>c_rate-min_charge.
|
||||
rv_cost = {{p}}if_shipping_cost=>c_rate-min_charge.
|
||||
ENDIF.
|
||||
|
||||
IF iv_express = abap_true.
|
||||
rv_cost = rv_cost + express_surcharge( rv_cost ).
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_rate.
|
||||
IF iv_weight < 1.
|
||||
rv_rate = '4.90'.
|
||||
ELSEIF iv_weight < 5.
|
||||
rv_rate = '8.50'.
|
||||
ELSEIF iv_weight < 10.
|
||||
rv_rate = '12.00'.
|
||||
ELSEIF iv_weight < {{p}}if_shipping_cost=>c_rate-bulk_weight.
|
||||
rv_rate = '18.75'.
|
||||
ELSE.
|
||||
DATA lv_started_kg TYPE i.
|
||||
lv_started_kg = iv_weight - {{p}}if_shipping_cost=>c_rate-bulk_weight.
|
||||
rv_rate = '18.75' + lv_started_kg * {{p}}if_shipping_cost=>c_rate-bulk_step.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD express_surcharge.
|
||||
rv_surcharge = round( val = iv_rate * {{p}}if_shipping_cost=>c_rate-express_percent / 100
|
||||
dec = 2 ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user