Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
46 lines
1.8 KiB
Markdown
46 lines
1.8 KiB
Markdown
# 1. Goal
|
|
A bicycle repair shop prices repair jobs. The workshop program calls one function
|
|
module for each repair job before it prints the work order. The new function
|
|
module must have the same interface as the sample pricing module, because the
|
|
workshop program calls all pricing modules in the same way.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- Function group {{P}}FG_REPAIR exists in package $TMP.
|
|
- Function module {{P}}REPAIR_SAMPLE exists in this group. It is the sample
|
|
pricing module. Its interface is the interface that all pricing modules must
|
|
use.
|
|
|
|
# 4. Contract
|
|
- Create the function module {{P}}REPAIR_FEE in function group {{P}}FG_REPAIR.
|
|
- Use exactly the interface of {{P}}REPAIR_SAMPLE: the same parameter names,
|
|
kinds, types, and exceptions.
|
|
|
|
# 5. Business rules
|
|
1. If the hours are less than zero, raise the exception INVALID_HOURS.
|
|
2. The hourly rate depends on the repair type:
|
|
- 'BR' brake repair: 60.00
|
|
- 'GE' gear repair: 45.00
|
|
- 'WH' wheel repair: 30.00
|
|
- every other type: 40.00
|
|
3. The labour fee is the hours multiplied by the hourly rate. Round the labour
|
|
fee half up to 2 decimals. Return it in ev_labour_fee.
|
|
4. If the customer is a club member, reduce the labour fee by 10 %. Round the
|
|
reduction half up to 2 decimals. Return the reduced labour fee in
|
|
ev_labour_fee.
|
|
5. The total fee is the labour fee from rule 3 or rule 4 plus the parts cost.
|
|
Return it in ev_total_fee.
|
|
6. If the total fee is less than 25.00, set the total fee to 25.00.
|
|
|
|
# 6. Constraints
|
|
- Release target: 7.02. Use only syntax that release 7.02 supports.
|
|
- Coding standards: Clean ABAP. Keep every method below 40 statements.
|
|
- Out of scope: do not change {{P}}REPAIR_SAMPLE.
|
|
|
|
# 7. Acceptance
|
|
- The function module is active and has no syntax error.
|
|
- The hidden tests pass.
|
|
- Write ABAP Unit tests for the function module in a global test class.
|