79 lines
3.0 KiB
Markdown
79 lines
3.0 KiB
Markdown
# 1. Goal
|
|
|
|
A pottery studio fires the ceramic pieces of its customers in three kilns. The
|
|
studio has two front ends: a terminal in the workshop and a web shop. Both front
|
|
ends must use the same interface for the firing quote. Create this interface.
|
|
|
|
# 2. Open questions
|
|
|
|
None.
|
|
|
|
# 3. Context
|
|
|
|
- The package is $TMP, client 001.
|
|
- The interface {{P}}IF_KILN_QUOTE does not exist yet.
|
|
- The interface is the only object of this task. The two front ends are not part
|
|
of this task.
|
|
- The interface has no implementation and no test include.
|
|
|
|
# 4. Contract
|
|
|
|
Create the public interface {{P}}IF_KILN_QUOTE in package $TMP. The interface has
|
|
exactly these public components.
|
|
|
|
Types:
|
|
- ty_reason: character, length 12.
|
|
- ty_kiln: character, length 4.
|
|
- ty_amount: packed number, length 7, 2 decimal places.
|
|
- ty_load: structure with the components kiln (ty_kiln), pieces (i), weight_kg (i)
|
|
and glazed (abap_bool), in this order.
|
|
- ty_quote: structure with the components kiln (ty_kiln), base (ty_amount),
|
|
weight (ty_amount), glaze (ty_amount), total (ty_amount) and reason (ty_reason),
|
|
in this order.
|
|
|
|
Constants:
|
|
- c_kiln: structure with the components small, medium and large. Each component
|
|
has the type ty_kiln.
|
|
- c_reason: structure with the components ok, kiln, pieces and weight. Each
|
|
component has the type ty_reason.
|
|
- c_base_small, c_base_medium, c_base_large, c_weight_rate and c_glaze_fee: each
|
|
has the type ty_amount.
|
|
- c_max_pieces and c_max_weight: each has the type i.
|
|
|
|
Methods:
|
|
- check_load: IMPORTING is_load TYPE ty_load, RETURNING VALUE(rv_reason) TYPE ty_reason.
|
|
- kiln_fee: IMPORTING iv_kiln TYPE ty_kiln, RETURNING VALUE(rv_fee) TYPE ty_amount.
|
|
- quote: IMPORTING is_load TYPE ty_load, RETURNING VALUE(rs_quote) TYPE ty_quote.
|
|
|
|
Do not add other public components.
|
|
|
|
# 5. Business rules
|
|
|
|
1. The kiln codes are SMAL for the small kiln, MEDI for the medium kiln and LARG
|
|
for the large kiln.
|
|
2. The reason codes are OK, KILN, PIECES and WEIGHT. OK means that the load is
|
|
valid. KILN means that the kiln code is not one of the three kiln codes.
|
|
PIECES means that the number of pieces is less than 1 or more than
|
|
c_max_pieces. WEIGHT means that the weight is less than 1 kilogram or more
|
|
than c_max_weight kilograms.
|
|
3. The base fee of one firing is 25.00 for the small kiln, 40.00 for the medium
|
|
kiln and 60.00 for the large kiln.
|
|
4. The weight fee is 1.50 for each kilogram.
|
|
5. The glaze surcharge is 8.00 for a glazed load and 0.00 for an unglazed load.
|
|
6. c_max_pieces is 40. c_max_weight is 120.
|
|
7. All amounts are in EUR and have 2 decimal places.
|
|
|
|
# 6. Constraints
|
|
|
|
- Release target: 8.16.
|
|
- Coding standards: Clean ABAP. No comment that restates the code.
|
|
- Out of scope: the two front ends and every other object. Do not create a global
|
|
implementation of the interface.
|
|
|
|
# 7. Acceptance
|
|
|
|
- The interface {{P}}IF_KILN_QUOTE is active and has no syntax error.
|
|
- The hidden tests pass.
|
|
- Write your own ABAP Unit tests in the global test class {{P}}IF_KILN_QUOTE_TEST
|
|
in package $TMP.
|