Pipeline controller: plan 2 (hard +, error +50 %), backlog throttle, 2 trajectory workers, stop rules, summaries every 50; budget reserve
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
13
tasks_gen/train/G1312/spec.md
Normal file
13
tasks_gen/train/G1312/spec.md
Normal file
@@ -0,0 +1,13 @@
|
||||
Hi, please refactor the class {{P}}PHONE_REPAIR_PRICER in package $TMP. The class prices repair orders for a mobile phone repair shop. The checkout program calls the class for each order and prints the price that the class returns. The class works, but its code is legacy code. It has one long method, repeated blocks, and prices that are hidden in the code. Refactor the class in place. The behavior must stay the same.
|
||||
|
||||
There are no open questions.
|
||||
|
||||
The class {{P}}PHONE_REPAIR_PRICER exists in package $TMP and is active. Its source code is the legacy code. The checkout program calls the public method CALCULATE_PRICE. It passes the device class, the repair type, the express flag, and the warranty flag. It prints the returned price. The class is in production. Its public interface must not change. The class has no tests.
|
||||
|
||||
Refactor the class {{P}}PHONE_REPAIR_PRICER in package $TMP. Keep the name. Do not create a second class. The class stays public and final. The constructor stays public and has no parameters. The public section stays as it is. It has the type TY_DEVICE (character 6), the type TY_REPAIR (character 8), and the type TY_PRICE (packed number, length 8, 2 decimals). It has the constants C_DEVICE_BASIC, C_DEVICE_MID, and C_DEVICE_HIGH of type TY_DEVICE. It has the constants C_REPAIR_SCREEN, C_REPAIR_BATTERY, C_REPAIR_BOARD, C_REPAIR_CAMERA, and C_REPAIR_PORT of type TY_REPAIR. It has the method CALCULATE_PRICE with the importing parameters IV_DEVICE (TY_DEVICE), IV_REPAIR (TY_REPAIR), IV_EXPRESS (ABAP_BOOL), and IV_WARRANTY (ABAP_BOOL), and the returning parameter RV_PRICE (TY_PRICE). Do not add other public methods, types, constants, or attributes.
|
||||
|
||||
The behavior of the class must not change. Every combination of the four input parameters must return the same price as before. The rules are in the legacy source code of the class. Read the legacy code. Keep every rule and keep the sequence of the steps. Do not add rules and do not remove rules.
|
||||
|
||||
The release target is ABAP Platform 2025 (SAP_BASIS 816). Use Clean ABAP. Methods must be below 40 statements. Do not use global variables. Do not write comments that restate the code. Replace the prices and the factors with named constants. Remove the repeated blocks. Use names that say what the data and the methods mean. Do not change the public interface of the class.
|
||||
|
||||
The class must be active and have no syntax error. The hidden tests must pass. Write your own ABAP Unit tests for the class.
|
||||
Reference in New Issue
Block a user