With the addition of a new transaction type and the change of the invoice approval logic, it became necessary to migrate data in the mod-finance-storage. However, to migrate data in the mod-finance-storage the data from the mod-invoice-storage are required. Therefore, an approach using API instead of SQL queries has been chosen. The mod-invoice was chosen to exclude the possibility of a cyclic dependency between finance and invoices, and not to create dependencies between storage modules.
Add /_/tenant API to module descriptor
Override TenantAPI.postTenant to add following logic:
- if moduleFrom version < planed version
- get all invoices and lines with status Approved
- create Pending payment for every fundDistribution
- send prepared Pending payments to POST /finance-storage/pending-payment-migration
- /_/tenant API added
- postTenant implemented as described
- unit tests?
- migration tested