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.
...
Note : Don't merge your PR and just provide for review
4. Add business logic to connect invoice line and order line
Connection should be stored in the DB if invoice line created based on order line.
4.1 Business API for creating invoice line → POST /invoice/invoice-lines}. Please find controller and service method which responsible for creating invoice line.
4.2 Add logic to the method founded in 4.1, which should create connection between order line and invoice line in the DB. Please use Storage API from Task 2
4.3 Deploy module mod-invoice with your updates. Check that connection is created using Postman collection.
4.4 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 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.
45.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}.
45.2 Go to mod-invoice-storage and find method which responsible for deleting invoice line from database.
45.3 Update logic of the method which you found in 45.2 by adding method, which should delete record of "po_line_vs_invoice_line". Learn org.folio.rest.persist.DBClient implementation.
45.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.
45.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
...
6. Add validation business logic
Should not be possible delete order line (DELETED /orders/order-line/{id}) if there is connection between order line and invoice line.
56.1 Business API for deleting order line → DELETE /orders/order-line/{id}. Please find controller and service method which responsible for deleting order line.
5.2
...
6.2 Add logic to the method founded in 6.1, which should block deletion order line and return error to user.
6.3 Deploy module mod-invoice-storage with your updates. Check that is not possible delete order line if there is connection to invoice line using Postman collection.
6.4 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