Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

The purpose of practical tasks in the implementation of CRUD API to insert/updating/obtaining the order line number with which the invoice line is associated.

Tasks

1.

...

Create/Update schema → mod-invoice-storage

First of all we need to define JSON schema "po_line_vs_invoice_line.json" for model which should contain next fields :

...

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

2. Define storage CRUD API → mod-invoice-storage

Storage modules in the FOLIO should contain logic for working only with the database.

...

Note : Don't merge your PR and just provide for review

3. Define business GET APIs → mod-invoice

Business modules in the FOLIO should contain business logic, calls to his storage module (mod-invoice → mod-invoice-storage) and should call third modules by using business APIs of this module.

...

Note : Don't merge your PR and just provide for review

4. Add business logic to connect invoice line and order line → mod-invoice

Connection should be stored in the DB if invoice line created based on order line.

...

Note : Don't merge your PR and just provide for review

5. Add DB transaction support → mod-invoice-storage

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").

...

5.3 Update logic of the method which you found in 5.2 by adding method, which should delete record of  "po_line_vs_invoice_line". Learn org.folio.rest.persist.DBClient implementation.

5.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.

...

Note : Don't merge your PR and just provide for review

6. Add validation business logic → mod-orders

Should not be possible delete order line (DELETED /orders/order-line/{id}) if there is connection between order line and invoice line.

...