1047: Refactor configuration of order file template

Test Case #:1047

Test Case Name: Refactor configuration of order file template

System: OpenLMIS

Subsystem:blue

Test case designed by: Paulina Borowa

Design Date:11.10.2016

Short description

Acceptance Criteria
Verify that:

  • an implementor can indicate to include or not include column headers (boolean)
  • Order Number column is generated using the order number template ( OLMIS-401 QA )
  • All column headers can be defined (renamed) by the implementor
  • Facility code column populates the facility code from the requisition information
  • Product Code column populates the product name from requisition information/reference data
  • Product Name column populates the product name from requisition information/reference data
  • Approved quantity column populates based on the approved quanitity column in the requisition
  • Period information populates based on the requisition
  • Period format is defined by the implementor, choices include
    • MM/yy
    • MM/yyyy
    • etc. - please include all options that are in 2.0 (update the story with all the options there)
  • Order date populates based on the date converted (PLEASE check 2.0 behavior - this may be on the approved date...needs to be verified)
  • Order date format is defined by the implementor, choices include
    • same as period format
  • Implementor can define the Order file prefix (PLEASE check 2.0 behavior if the prefix needs to match the Order Number Template prefix - I'm not sure)

                                                                                                                                                   

Pre – conditions:

    Demo-data                                                                                                                                                                                                                                                  

Step


Action

Expected system response

Comment

1

 Get from demo-data order

  In URL: http://10.222.17.205/requisition/api/orders/?access_token=ecffff4a-fd53-4da5-a748-803247f057c4

Method: GET

 Status 200 OK

id: 00000000-0000-0000-0000-000000000001

                                                 

2

 Get orderFileTemplate from demo-data

In URL: http://10.222.17.205/requisition/api/orderFileTemplates ?access_token=ecffff4a-fd53-4da5-a748-803247f057c4

Metgod: GET



3

Upgrade data for orderFileTemplate

in URL: In URL: http://10.222.17.205/requisition/api/orderFileTemplates ?access_token=ecffff4a-fd53-4da5-a748-803247f057c4

Method: POST

example body:

{
  "id": "457ed5b0-80d7-4cb6-af54-e3f6138c8128",
  "filePrefix": "O",
  "headerInFile": true,
  "orderFileColumns": [
    {
      "id": "33b2d2e9-3167-46b0-95d4-1295be9afc21",
      "openLmisField": true,
      "dataFieldLabel": "fulfillment.header.order.number",
      "columnLabel": "Order number123",
      "include": true,
      "position": 1,
      "format": "MM/yy",
      "nested": "order",
      "keyPath": "orderCode",
      "related": null,
      "relatedKeyPath": null,
      "orderFileTemplate": "457ed5b0-80d7-4cb6-af54-e3f6138c8128"
    },
    {
      "id": "6b8d331b-a0dd-4a1f-aafb-40e6a72ab9f6",
      "openLmisField": true,
      "dataFieldLabel": "fulfillment.header.facility.code",
      "columnLabel": "Facility code123",
      "include": true,
      "position": 1,
      "format": "MM/yy",
      "nested": "order",
      "keyPath": "requisition/facilityId",
      "related": "Facility",
      "relatedKeyPath": "code",
      "orderFileTemplate": "457ed5b0-80d7-4cb6-af54-e3f6138c8128"
    },
    {
      "id": "752cda76-0db5-4b6e-bb79-0f531ab78e2e",
      "openLmisField": true,
      "dataFieldLabel": "fulfillment.header.product.code",
      "columnLabel": "Product code123",
      "include": true,
      "position": 1,
      "format": "MM/yy",
      "nested": "lineItem",
      "keyPath": "orderableProductId",
      "related": "OrderableProduct",
      "relatedKeyPath": "productCode",
      "orderFileTemplate": "457ed5b0-80d7-4cb6-af54-e3f6138c8128"
    },
    {
      "id": "9e825396-269d-4873-baa4-89054e2722f5",
      "openLmisField": true,
      "dataFieldLabel": "fulfillment.header.product.name",
      "columnLabel": "Product name123",
      "include": true,
      "position": 1,
      "format": "MM/yy",
      "nested": "lineItem",
      "keyPath": "orderableProductId",
      "related": "OrderableProduct",
      "relatedKeyPath": "name",
      "orderFileTemplate": "457ed5b0-80d7-4cb6-af54-e3f6138c8128"
    },
    {
      "id": "cd57f329-f549-4717-882e-ecbf98122c39",
      "openLmisField": true,
      "dataFieldLabel": "fulfillment.header.approved.quantity",
      "columnLabel": "Approved quantity123",
      "include": true,
      "position": 1,
      "format": "MM/yy",
      "nested": "lineItem",
      "keyPath": "approvedQuantity",
      "related": null,
      "relatedKeyPath": null,
      "orderFileTemplate": "457ed5b0-80d7-4cb6-af54-e3f6138c8128"
    },
    {
      "id": "d0e1aec7-1556-4dc1-8e21-d80a2d76b678",
      "openLmisField": true,
      "dataFieldLabel": "fulfillment.header.period",
      "columnLabel": "Period123",
      "include": true,
      "position": 1,
      "format": "MM/yy",
      "nested": "order",
      "keyPath": "requisition/processingPeriodId",
      "related": "ProcessingPeriod",
      "relatedKeyPath": "startDate",
      "orderFileTemplate": "457ed5b0-80d7-4cb6-af54-e3f6138c8128"
    },
    {
      "id": "dab6eec0-4cb4-4d4c-94b7-820308da73ff",
      "openLmisField": true,
      "dataFieldLabel": "fulfillment.header.order.date",
      "columnLabel": "Order date123",
      "include": true,
      "position": 1,
      "format": "dd/MM/yy",
      "nested": "order",
      "keyPath": "createdDate",
      "related": null,
      "relatedKeyPath": null,
      "orderFileTemplate": "457ed5b0-80d7-4cb6-af54-e3f6138c8128"
    }
  ]
}

Status 200 OK

Check acceptance criteria:

* all column headers can be defined (renamed) by the implementor

* Facility code column populates the facility code from the requisition information

* Product Code column populates the product name from requisition information/reference data

* Product Name column populates the product name from requisition information/reference data

* Approved quantity column populates based on the approved quanitity column in the requisition

* Period information populates based on the requisition

* Period format is defined by the implementor, choices include

* Order date populates based on the date converted

* Order date format is defined by the implementor, choices include, same as period format

* Implementor can define the Order file prefix

4

To see if the changes save, check endpoint:

URL: http://10.222.17.205/requisition/api/orders/00000000-0000-0000-0000-000000000001/csv?access_token=caf0a651-d8a4-4390-8c86-800901d5e915

Method: GET

 


OpenLMIS: the global initiative for powerful LMIS software