Feature: Penalty account of an employee
Description
HR records penalties of an employee (create): an amount in minor units of the company currency, a
leave deduction, or both, each only of a kind the company enabled. The employee, managers in scope and HR read them
(list). Packages record penalties through the same service with the records they are for, such
as a late arrival; a record belongs to at most one penalty, and recording it again is answered with that penalty.
Penalty is published once with the penalty ID as idempotency key, and the employee is told through
employee..
A leave deduction is checked by the leave package before the penalty is stored; without it, a leave deduction is refused.
Impact
Two new tables (one migration). Payroll and leave book from Penalty once they consume it.