2.2 KiB
2.2 KiB
1. Goal
A mountain rescue service records each callout of its rescue teams. The service must store the callouts in a database table. A report and an OData service read the callouts later. Therefore the table needs a fixed structure.
2. Open questions
None.
3. Context
- Package $TMP, client 001. No transports.
- The table is new. No other object of this task exists.
- A callout is the work of one rescue team for one incident.
- The client and the callout ID identify one callout.
4. Contract
- Create the database table {{P}}RESCUE in package $TMP.
- The table contains these fields, in this order: client, callout_id, callout_date, location, duration_min, team_size, rescued_count, fee_amount, currency_code.
5. Business rules
- The key fields of the table are client and callout_id.
- client has the type abap.clnt and is not null.
- callout_id has the type abap.char(10) and is not null. A callout ID is unique for one client.
- callout_date has the type abap.dats and is not null. It is the day of the callout.
- location has the type abap.char(30). It is the place of the incident. The location can be empty.
- duration_min has the type abap.int4. It is the duration of the callout in minutes.
- team_size has the type abap.int4. It is the number of rescuers.
- rescued_count has the type abap.int4. It is the number of persons that the team rescued.
- fee_amount has the type abap.dec(13,2). It is the fee for the callout.
- currency_code has the type abap.cuky. It is the currency of fee_amount. fee_amount is an amount and refers to the currency field of the same table.
- The table keeps one row for each pair of client and callout_id. A second insert with the same pair returns sy-subrc = 4.
6. Constraints
- Release target: 8.16.
- Use only built-in types: abap.clnt, abap.char, abap.dats, abap.int4, abap.dec, abap.cuky.
- The table is not extensible. Delivery class A. Data maintenance is restricted.
- Write clean ABAP. Do not create ATC priority 1 or priority 2 findings.
- Out of scope: all other objects in package $TMP.
7. Acceptance
- The table {{P}}RESCUE is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests with CL_OSQL_TEST_ENVIRONMENT in a global test class.