63 lines
2.9 KiB
Markdown
63 lines
2.9 KiB
Markdown
# 1. Goal
|
|
A sailmaker loft repairs sails for yacht owners. Two intake points send a repair
|
|
order to the same check: the loft counter and the online form. Both intake points
|
|
and the loft work with one interface. The interface is the shared contract of the
|
|
repair order check. It holds the codes, the limits and the method signature.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- The interface {{P}}IF_SAIL_REPAIR does not exist yet. Create it in package $TMP.
|
|
- A repair order has a damage code, a cloth code, the damaged length in
|
|
centimetres, and a rush flag.
|
|
- The loft knows four damage codes, three cloth codes and two limits.
|
|
- The intake points call the method of the interface before they accept an order.
|
|
|
|
# 4. Contract
|
|
- Create the interface {{P}}IF_SAIL_REPAIR in package $TMP.
|
|
- The interface has these public types: TY_REASON (character 10),
|
|
TY_DAMAGE (character 4) and TY_CLOTH (character 4).
|
|
- The interface has the public constant structure C_REASON with the components
|
|
OK, EMPTY, DAMAGE, CLOTH, LENGTH and RUSH. Each component has the type
|
|
TY_REASON.
|
|
- The interface has the public constant structure C_DAMAGE with the components
|
|
TEAR, SEAM, EYLT and BATT. Each component has the type TY_DAMAGE.
|
|
- The interface has the public constant structure C_CLOTH with the components
|
|
LITE, MEDM and HEAV. Each component has the type TY_CLOTH.
|
|
- The interface has the public constants C_MAX_LENGTH and C_RUSH_LIMIT, both of
|
|
type I.
|
|
- The interface has one method CHECK_ORDER with the importing parameters
|
|
IV_DAMAGE (type TY_DAMAGE), IV_CLOTH (type TY_CLOTH), IV_LENGTH (type I) and
|
|
IV_RUSH (type ABAP_BOOL) and the returning parameter RV_REASON (type
|
|
TY_REASON).
|
|
- Do not add other public components.
|
|
|
|
# 5. Business rules
|
|
1. The reason codes have these values: OK = 'OK', EMPTY = 'EMPTY',
|
|
DAMAGE = 'DAMAGE', CLOTH = 'CLOTH', LENGTH = 'LENGTH', RUSH = 'RUSH'.
|
|
2. The damage codes have these values: TEAR = 'TEAR', SEAM = 'SEAM',
|
|
EYLT = 'EYLT', BATT = 'BATT'.
|
|
3. The cloth codes have these values: LITE = 'LITE', MEDM = 'MEDM',
|
|
HEAV = 'HEAV'.
|
|
4. C_MAX_LENGTH is 400. C_RUSH_LIMIT is 200.
|
|
5. TY_REASON is 10 characters long. TY_DAMAGE is 4 characters long. TY_CLOTH is
|
|
4 characters long.
|
|
6. The method CHECK_ORDER has exactly the importing parameters IV_DAMAGE,
|
|
IV_CLOTH, IV_LENGTH and IV_RUSH and the returning parameter RV_REASON.
|
|
IV_DAMAGE has the type TY_DAMAGE. IV_CLOTH has the type TY_CLOTH. IV_LENGTH
|
|
has the type I. IV_RUSH has the type ABAP_BOOL. RV_REASON has the type
|
|
TY_REASON.
|
|
|
|
# 6. Constraints
|
|
- Release target: ABAP Platform 2025 (SAP_BASIS 816).
|
|
- Coding standards: Clean ABAP. No global variables. No comment that restates
|
|
the code.
|
|
- Out of scope: do not create an implementation class. Do not change other
|
|
objects in package $TMP.
|
|
|
|
# 7. Acceptance
|
|
- The interface {{P}}IF_SAIL_REPAIR is active and has no syntax error.
|
|
- The hidden tests pass.
|
|
- Write your own ABAP Unit tests for the interface.
|