Uploaded image for project: 'mod-gobi'
  1. mod-gobi
  2. MODGOBI-159

Define API and update schemas for retrieving Folio fields and translators

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Duplicate
    • None
    • None
    • None
    • Thunderjet
    • TBD

    Description

      Purpose/Overview:
      As a system administrator,
      I want to be able to access the details I need to setup the GOBI integration
      so that I don't need to contact FOLIO support to setup or adjust my GOBI integration

      Requirements/Scope:

      1. Return list of order types for which integration is possible
      2. Return GOBI integration default or custom mappings based on order type

      Approach:
      1. Define API for retrieving GOBI mapping
      1.1 Add new schema OrderMappingsCollection.json which is colection of mod-gobi\src\main\resources\OrderMappings.json
      1.2 Create new endpoint "/order-mappings" in the "\mod-gobi\ramls\gobi.raml".

      GET collection of ENUM from OrderMappings.json : /gobi/orders/mappings/types.
      Content-type : application/json
      Http response 200
      Full list of types :

                "orderType": {
                  "type": "string",
                  "description": "The type of the GOBI order",
                  "enum": [
                    "ListedElectronicMonograph",
                    "ListedElectronicSerial",
                    "ListedPrintMonograph",
                    "ListedPrintSerial",
                    "UnlistedPrintMonograph",
                    "UnlistedPrintSerial"
                  ]
                }
      

      GET collection of OrderMappingsCollection.json : /gobi/orders/mappings.
      Content-type : application/json
      Http response 200

      GET item of OrderMappings.json : /gobi/orders/mappings/<orderType>.
      Content-type : application/json
      Http response 200

      PUT update mapping for the specified order type : /gobi/orders/mappings/<orderType>
      Body: OrderMappings.json. Http response 204

      POST update mapping for the specified order type : /gobi/orders/mappings
      Body: OrderMappings.json. Http response 201

      DELETE delete mapping for the specified order type : /gobi/orders/mappings/<orderType>

      2. Implement new APIs
      Note : Configs now are stored in the mod-configuration and should be stored in the mod-configuration
      Example for ListedPrintMonograph

      {
        "module": "GOBI",
        "configName": "orderMappings",
        "code": "gobi.order.ListedPrintMonograph",
        "description": "GOBI order mappings",
        "enabled": true,
        "value": "{\n  \"orderType\": \"ListedPrintMonograph\",\n  \"mappings\": [\n    {\n      \"field\": \"ACQUISITION_METHOD\",\n      \"dataSource\": {\n        \"default\": \"Purchase At Vendor System\"\n      }\n    },\n    {\n      \"field\": \"APPROVED\",\n      \"dataSource\": {\n        \"default\": \"true\",\n        \"translation\": \"toBoolean\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"CLAIMED\",\n      \"dataSource\": {\n        \"default\": \"true\",\n        \"translation\": \"toBoolean\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"COLLECTION\",\n      \"dataSource\": {\n        \"default\": \"false\",\n        \"translation\": \"toBoolean\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"CONTRIBUTOR\",\n      \"dataSource\": {\n        \"from\": \"//datafield[@tag='100']/*\",\n        \"combinator\": \"concat\"\n      }\n    },\n    {\n      \"field\": \"CONTRIBUTOR_NAME_TYPE\",\n      \"dataSource\": {\n        \"default\": \"Personal name\",\n        \"translation\": \"lookupContributorNameTypeId\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"CURRENCY\",\n      \"dataSource\": {\n        \"from\": \"//ListPrice/Currency\",\n        \"default\": \"USD\"\n      }\n    },\n    {\n      \"field\": \"DATE_ORDERED\",\n      \"dataSource\": {\n        \"from\": \"//OrderPlaced\",\n        \"translation\": \"toDate\"\n      }\n    },\n    {\n      \"field\": \"FUND_ID\",\n      \"dataSource\": {\n        \"from\": \"//FundCode\",\n        \"translation\": \"lookupFundId\"\n      }\n    },\n    {\n      \"field\": \"FUND_CODE\",\n      \"dataSource\": {\n        \"from\": \"//FundCode\"\n      }\n    },\n    {\n      \"field\": \"FUND_PERCENTAGE\",\n      \"dataSource\": {\n        \"default\": \"100\",\n        \"translation\": \"toDouble\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"VENDOR_INSTRUCTIONS\",\n      \"dataSource\": {\n        \"from\": \"//OrderNotes\",\n        \"default\": \"N/A\"\n      }\n    },\n    {\n      \"field\": \"LIST_UNIT_PRICE\",\n      \"dataSource\": {\n        \"from\": \"//ListPrice/Amount\",\n        \"default\": \"0\",\n        \"translation\": \"toDouble\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"LOCATION\",\n      \"dataSource\": {\n        \"from\": \"//Location\",\n        \"default\": \"*\",\n        \"translation\": \"lookupLocationId\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"MANUAL_PO\",\n      \"dataSource\": {\n        \"default\": \"false\",\n        \"translation\": \"toBoolean\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"ORDER_TYPE\",\n      \"dataSource\": {\n        \"default\": \"One-Time\"\n      }\n    },\n    {\n      \"field\": \"PO_LINE_ORDER_FORMAT\",\n      \"dataSource\": {\n        \"default\": \"Physical Resource\"\n      }\n    },\n    {\n      \"field\": \"PO_LINE_PAYMENT_STATUS\",\n      \"dataSource\": {\n        \"default\": \"Awaiting Payment\"\n      }\n    },\n    {\n      \"field\": \"PO_LINE_RECEIPT_STATUS\",\n      \"dataSource\": {\n        \"default\": \"Awaiting Receipt\"\n      }\n    },\n    {\n      \"field\": \"PRODUCT_ID\",\n      \"dataSource\": {\n        \"from\": \"//datafield[@tag='020']/subfield[@code='a']\",\n        \"translation\": \"truncateISBNQualifier\"\n      }\n    },\n    {\n      \"field\": \"PRODUCT_ID_TYPE\",\n      \"dataSource\": {\n        \"default\": \"ISBN\",\n        \"translation\": \"lookupProductIdType\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"PRODUCT_QUALIFIER\",\n      \"dataSource\": {\n        \"from\": \"//datafield[@tag='020']/subfield[@code='q']\",\n        \"defaultMapping\": {\n          \"dataSource\": {\n            \"from\": \"//datafield[@tag='020']/subfield[@code='a']\",\n            \"translation\": \"separateISBNQualifier\"\n          }\n        }\n      }\n    },\n    {\n      \"field\": \"PUBLICATION_DATE\",\n      \"dataSource\": {\n        \"from\": \"//datafield[@tag='260']/subfield[@code='c']\"\n      }\n    },\n    {\n      \"field\": \"PUBLISHER\",\n      \"dataSource\": {\n        \"from\": \"//datafield[@tag='260']/subfield[@code='b']\"\n      }\n    },\n    {\n      \"field\": \"QUANTITY_PHYSICAL\",\n      \"dataSource\": {\n        \"from\": \"//Quantity\",\n        \"default\": \"1\",\n        \"translation\": \"toInteger\"\n      }\n    },\n    {\n      \"field\": \"SOURCE\",\n      \"dataSource\": {\n        \"default\": \"API\"\n      }\n    },\n    {\n      \"field\": \"TITLE\",\n      \"dataSource\": {\n        \"from\": \"//datafield[@tag='245']/*\",\n        \"combinator\": \"concat\"\n      }\n    },\n    {\n      \"field\": \"VENDOR\",\n      \"dataSource\": {\n        \"default\": \"GOBI\",\n        \"translation\": \"lookupOrganization\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"MATERIAL_SUPPLIER\",\n      \"dataSource\": {\n        \"default\": \"GOBI\",\n        \"translation\": \"lookupOrganization\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"VENDOR_ACCOUNT\",\n      \"dataSource\": {\n        \"from\": \"//SubAccount\",\n        \"default\": \"0\"\n      }\n    },\n    {\n      \"field\": \"VENDOR_REF_NO\",\n      \"dataSource\": {\n        \"from\": \"//YBPOrderKey\"\n      }\n    },\n    {\n      \"field\": \"VENDOR_REF_NO_TYPE\",\n      \"dataSource\": {\n        \"default\": \"Vendor order reference number\"\n      }\n    },\n    {\n      \"field\": \"WORKFLOW_STATUS\",\n      \"dataSource\": {\n        \"default\": \"Open\"\n      }\n    },\n    {\n      \"field\": \"MATERIAL_TYPE\",\n      \"dataSource\": {\n        \"from\": \"//LocalData[Description='LocalData1']/Value\",\n        \"default\": \"unspecified\",\n        \"translation\": \"lookupMaterialTypeId\",\n        \"translateDefault\": true\n      }\n    },\n    {\n      \"field\": \"LINKED_PACKAGE\",\n      \"dataSource\": {\n        \"from\": \"//LocalData[Description='LocalData2']/Value\",\n        \"translation\": \"lookupLinkedPackage\"\n      }\n    },\n    {\n      \"field\": \"SHIP_TO\",\n      \"dataSource\": {\n        \"from\": \"//LocalData[Description='LocalData3']/Value\",\n        \"translation\": \"lookupConfigAddress\"\n      }\n    },\n    {\n      \"field\": \"PREFIX\",\n      \"dataSource\": {\n        \"from\": \"//LocalData[Description='LocalData4']/Value\",\n        \"translation\": \"lookupPrefix\"\n      }\n    }\n  ]\n}"
      }
      

      Acceptance criteria:

      • API defined and implemented
      • Unit tests created
      • API test created

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                Andrei_Makaranka Andrei Makaranka
                Andrei_Makaranka Andrei Makaranka
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases