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.


Useful links and information

Full flow - Onboarding.postman_collection.json - Download this collection that allows you to create an order with an order line as well as an invoice and an invoice line based on the order line.

Apply last update from sub-module.PNG - How to set your sub module on specific commit or branch

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 :

NameTypeMandatoryDescriptionNote
idUUIDYUnique identifier.This field is mandatory for RMB
poLineIdUUIDYReference on order line 
poLineNumberPatternYNumber of the order lineThe same pattern as in the po_line.json
invoiceLineIdUUIDYReference on invoice line
invoiceLineNumberStringYNumber of the invoice line


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

! Important (issue with module upgrade and load sample and reference)


Code Block
languagejava
titleWorkaround
collapsetrue
{{okapiprotocol}}://{{okapiurl}}:{{okapiport}}/_/proxy/tenants/{{xokapitenant}}/install?tenantParameters=loadSample=false,loadReference=false
12:49
  @Override
  public Future<Integer> loadData(TenantAttributes attributes, String tenantId, Map<String, String> headers, Context vertxContext) {
//    log.info("postTenant");
//    Vertx vertx = vertxContext.owner();
//    Parameter parameter = new Parameter().withKey(PARAMETER_LOAD_SYSTEM).withValue("true");
//    attributes.getParameters().add(parameter);
//
//    TenantLoading tl = new TenantLoading();
//    buildDataLoadingParameters(attributes, tl);
//
//    DBClient client = new DBClient(vertxContext, headers);
//
//    return Future.succeededFuture()
//      .compose(v -> migration(attributes, "mod-invoice-storage-5.2.0",
//        () -> migrationService.syncOrderPoNumbersWithInvoicePoNumbers(headers, vertxContext)))
//      .compose(v -> {
//
//        Promise<Integer> promise = Promise.promise();
//
//        tl.perform(attributes, headers, vertx, res -> {
//          if (res.failed()) {
//            promise.fail(res.cause());
//          } else {
//            promise.complete(res.result());
//          }
//        });
//        return promise.future();
//      })
//      .onFailure(throwable -> Future.failedFuture(throwable.getCause()));
    return Future.succeededFuture(0);
  }

3. Define business GET APIs → mod-invoice

...