Table of Contents |
---|
...
On the FOLIO project JSON schema is used to define models which will be used as REST request/response and also save in the PostgreSQL : https://json-schema.org/
https://github.com/folio-org/acq-models → This is the central repository for the models of the various acquisition modules.
1.1 Please create schema "po_line_vs_invoice_line.json" in the mod-invoice-storage/schemas of theacq-models. Also add examplemod-invoice-storage/examples.
...
4. Add DB transaction support
If we delete the invoice line, then we need to delete the links between the order line and the invoice line (delete record of "po_line_vs_invoice_line").
To ensure data consistency, this operation must be atomic and performed within a single database transaction.
4.1 Business API for deleting invoice line : DELETE /invoices/invoice-lines/{id} and finally Storage API will be invoked DELETE /invoices-storage/invoice-lines/{id}.
4.2 Go to mod-invoice-storage and find method which responsible for deleting invoice line from database.
4.3 Update logic of the method which you found in 4.2 by adding method, which should delete record of "po_line_vs_invoice_line". Learn org.folio.rest.persist.DBClient implementation.
4.4 Deploy module mod-invoice-storage with your updates. Check that invoice line will be deleted with "po_line_vs_invoice_line" using Postman collection.
4.5 Commit and push new schema in the branch "onboarding/<EPAM_login>" and create PR in the "onboarding_<release_name>". In the PR attach screen that API works
Note : Don't merge your PR and just provide for review
5. Add validation business logic
...