Files

1.8 KiB

1. Goal

A translation agency prices translation jobs. The invoicing program calls one event module for each job. The event module must have the same interface as the sample event module, because the invoicing program calls all event modules in the same way.

2. Open questions

None.

3. Context

  • Function group {{P}}FG_TRL exists in package $TMP.
  • Function module {{P}}TRL_SAMPLE exists in this group. It is the sample event module. Its interface is the interface that all event modules must use.

4. Contract

  • Create the function module {{P}}TRL_PRICE in function group {{P}}FG_TRL.
  • Use exactly the interface of {{P}}TRL_SAMPLE: the same parameter names, parameter kinds, parameter types, and exceptions.

5. Business rules

  1. If the word count is less than 0, raise the exception INVALID_WORDS. Do not change the price.
  2. If the word count is 0, the price is 0. The minimum price in rule 6 does not apply.
  3. The base rate for one word depends on the language pair. Compare the language codes exactly as they are given.
    • Source EN and target DE, or source DE and target EN: 0.12
    • Source EN and target FR, or source FR and target EN: 0.15
    • All other pairs: 0.20
  4. The base amount is the word count multiplied by the base rate.
  5. If the express flag is true, multiply the base amount by 1.25.
  6. The price is the amount from rules 4 and 5, rounded half up to 2 decimals. If the price is less than 25.00, the price is 25.00.

6. Constraints

  • Release target: 8.16.
  • Coding standards: Clean ABAP. The code must not cause ATC findings of priority 1 or priority 2.
  • Out of scope: do not change {{P}}TRL_SAMPLE.

7. Acceptance

  • The function module {{P}}TRL_PRICE is active and has no syntax error.
  • The hidden tests pass.
  • Write ABAP Unit tests for the function module in a global test class.