812:Configure Beginning Balance attribute

 Test Case #:812

Test Case Name: Configure Beginning Balance attribute

System:

Subsystem:requisition

Test case designed by: Paulina Borowa

Design Date:02.0582016

Short descriptionVerify that:

  • beginning balance column is displayed/available on the requisition form, when selected to be
  • beginning balance column is NOT displayed/available on the requisition form when not selected
  • beginning balance is populated by the last requisition's 'stock in hand(E)'
  • there is an option for the implementer to indicate if users can override the populated value
  • implementers can define the data validation rule allowing data entry staff to modify the populated "Beginning Balance" amounts on the requisition form
    • when selected, users can modify the amounts
    • data entry selection made is upheld
  • the attribute is displayed in the defined order on the form
  • only non-negative and integer are allowed
  • only users, based on permissions, are allowed to define template attributes
  • data validations should match 2.0 functionality

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       


 Step

Action

Expected system response

Comment

1

 Request a token from authentication service with some rest client:
POST :                                                                                 

                                                       

                                                                 

                                                 

2

Create facilityTypes

In URL:

http://localhost:8080/api/facilityTypes?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"code":"facility"

}

Status 201 created,

id:"http://localhost:8080/api/facilityTypes/17fa7b6d-408b-483c-86e7-605aa5d58954"

 

3

Create geographicLevel

In URL:

http://localhost:8080/api/geographicLevels?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"code":"GL",

"levelNumber":"11"

}

Status 201 created,

id: "http://localhost:8080/api/geographicLevels/9f069652-819a-469a-912e-0852b08fe466"

 

4

Create geographicZones

In URL:

http://localhost:8080/api/geographicZones?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"code":"GeoZon2",

"level":"http://localhost:8080/api/geographicLevels/9f069652-819a-469a-912e-0852b08fe466",

"name":"test"

}

Status 201 created,

id:"http://localhost:8080/api/geographicZones/c7baa8e8-619f-426e-bd31-72228a7fc0e2"

 

5

Create schedules

In URL:

http://localhost:8080/api/schedules?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"code": "codecode121",

"name": "scheduleNamee"

}

Status 201 created,

id: "http://localhost:8080/api/schedules/24d9ae07-7e51-44ac-aff4-93a26674e94b"

 

6

Create productCategories

In URL:

http://localhost:8080/api/productCategories/?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"code":"kateg91",

"name":"testy19y",

"displayOrder":"8"

}

Status 201 created,

id:"http://localhost:8080/api/productCategories/0cb35417-b79c-41f9-a2a7-679d7bac9d7d"

 

7

Create programs

In URL:

http://localhost:8080/api/programs?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"code":"programs3"

}

Status 201 created,

id: "http://localhost:8080/api/programs/f51cb734-dfd7-4a98-944a-f33a9fad71c2"

 

8

                       

Create requisitionTemplates

In URL:

http://localhost:8080/api/requisitionTemplates?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"program":"http://localhost:8080/api/programs/f51cb734-dfd7-4a98-944a-f33a9fad71c2",

"columnsMap":

{"beginningBalance":

{"name":"beginningBalance",

"label":"beginningBalance",

"displayOrder":1,

"isDisplayed":true,

"isDisplayRequired":true,

"canChangeOrder":true,

"canBeChangedByUser":true,

"source":"CALCULATED"}

}

}


                         

Status 201 created,

id: "http://localhost:8080/api/requisitionTemplates/a894927d-a7fc-412a-ace1-212a1ecf1d5c"

 

9

Create facilities

In URL:

http://localhost:8080/api/facilities?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"code":"facilitiees21",

"geographicZone":"http://localhost:8080/api/geographicZones/c7baa8e8-619f-426e-bd31-72228a7fc0e2",

"type":"http://localhost:8080/api/facilityTypes/17fa7b6d-408b-483c-86e7-605aa5d58954",

"active":true,

"enabled":false

}

Status 201 created,

id: "http://localhost:8080/api/facilities/9212719f-b9f2-44a1-9d0b-7cf3f8256e5b"

 
10

Create products

In URL:

http://localhost:8080/api/products/?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"code":"product1d",

"primaryName":"text",

"dispensingUnit":"1",

"dosesPerDispensingUnit":"12",

"packSize":"1",

"packRoundingThreshold":"3",

"roundToZero":true,

"active":true,

"fullSupply":true,

"tracer":true,

"productCategory":"http://localhost:8080/api/productCategories/0cb35417-b79c-41f9-a2a7-679d7bac9d7d"

}

Status 201 created,

id: "http://localhost:8080/api/products/5021a557-1dea-4824-bbf1-e109f7684ec5"

 
11

Create periods

In URL:

http://localhost:8080/api/periods/?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"processingSchedule": {

"id": "24d9ae07-7e51-44ac-aff4-93a26674e94b",

"code": "codecode121",

"description": null,

"modifiedDate": "2016-08-02T07:35:39.084",

"name": "scheduleNamee"

},

"name": "name90",

"description": "descriptiontest",

"startDate": "2016-07-15",

"endDate": "2016-07-16"

}

Status 201 created,

id: "3c0e363d-8532-4fe6-9ad7-168aa85598de",

 
12

Create periods

In URL:

http://localhost:8080/api/periods/?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"processingSchedule": {

"id": "24d9ae07-7e51-44ac-aff4-93a26674e94b",

"code": "codecode121",

"description": null,

"modifiedDate": "2016-08-02T07:35:39.084",

"name": "scheduleNamee"

},

"name": "name90",

"description": "descriptiontest",

"startDate": "2016-07-17",

"endDate": "2016-07-18"

}

 With the same schedules as previously created periods.
13

Create requisition entity

In URL:

http://localhost:8080/api/requisitions?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"facility":"http://localhost:8080/api/facilities/9212719f-b9f2-44a1-9d0b-7cf3f8256e5b",

"program":"http://localhost:8080/api/programs/f51cb734-dfd7-4a98-944a-f33a9fad71c2",

"processingPeriod":"http://localhost:8080/api/periods/3c0e363d-8532-4fe6-9ad7-168aa85598de",

"status":"SUBMITTED"

}

Status 201 created,

id: "http://localhost:8080/api/requisitions/c16394e5-89ea-4f3a-a879-14cb52e43019"

 
14

Create RequisitionLine entity

In URL:

http://localhost:8080/api/requisitionLines/?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"product":"http://localhost:8080/api/products/5021a557-1dea-4824-bbf1-e109f7684ec5",

"stockInHand":"22",

"requisition":"http://localhost:8080/api/requisitions/c16394e5-89ea-4f3a-a879-14cb52e43019"

}

Status 201 created,

id: "http://localhost:8080/api/requisitionLines/42490bd9-9b12-4701-89f5-f76c4b3191dc"

Need to add value to "stockInHand",

Use requisition containing periods with earlier date.


15

Create another RequisitionLine

In URL:

http://localhost:8080/api/requisitionLines/?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"product":"http://localhost:8080/api/products/5021a557-1dea-4824-bbf1-e109f7684ec5",

}

Status 201 created,

id: "http://localhost:8080/api/requisitionLines/7b3aba26-e178-4b5c-b15c-a5b953c7e9cb"

The same product entity as previously created RequisitionLine
16

Create another requisition entity

In URL:

http://localhost:8080/api/requisitions/initiate?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Post:

Example Body:

{

"id":"19c6817f-8b93-465f-9c28-d1a66d2f55f8",

"facility":{

"id": "9212719f-b9f2-44a1-9d0b-7cf3f8256e5b",

"name": null,

"description": null,

"active": true,

"goLiveDate": null,

"goDownDate": null,

"comment": null,

"enabled": false,

"openLmisAccessible": null,

"type": {

"id":"17fa7b6d-408b-483c-86e7-605aa5d58954",

"code": "facility",

"name": null,

"description": null,

"displayOrder": null,

"active": null

},

"geographicZone":

{

"id":"c7baa8e8-619f-426e-bd31-72228a7fc0e2",

"code": "GeoZon2",

"level": {

"id":"9f069652-819a-469a-912e-0852b08fe466",

"code": "GL",

"name": null,

"levelNumber": 11

}

}

},

"program":{

"id": "f51cb734-dfd7-4a98-944a-f33a9fad71c2",

"code":"programs3",

"name": null

},

"processingPeriod":

{

"id": "362d246f-3b3d-4022-ab3d-6c4c1e6dbbb2",

"processingSchedule": {

"id": "24d9ae07-7e51-44ac-aff4-93a26674e94b",

"code": "codecode121",

"description": null,

"modifiedDate": "2016-08-02T07:35:39.084",

"name": "scheduleNamee"

},

"name": "name90",

"description": "descriptiontest",

"startDate": "2016-07-17",

"endDate": "2016-07-18"

},

"status":"INITIATED",

"requisitionLines":[

{

"id":"7b3aba26-e178-4b5c-b15c-a5b953c7e9cb",

"product":{

"id":"5021a557-1dea-4824-bbf1-e109f7684ec5",

"code": "product1d",

"primaryName": "text",

"dispensingUnit": "1",

"dosesPerDispensingUnit": 12,

"packSize": 1,

"packRoundingThreshold": 3,

"roundToZero": true,

"active": true,

"fullSupply": true,

"tracer": true,

"productCategory": {

"id":"0cb35417-b79c-41f9-a2a7-679d7bac9d7d",

"code": "kateg91",

"name": "testy19y",

"displayOrder": 8

}

},

"stockInHand": null,

"beginningBalance": null,

"totalReceivedQuantity": null,

"totalLossesAndAdjustments": null,

"stockOnHand": null,

"requestedQuantity": null,

"totalConsumedQuantity": null,

"requestedQuantityExplanation": null}

]

}

Status 201 created,

BeginningBalance
value should be the same as value stockInHand in RequisitionLine entity 

17

Check the beginningBalance value of the second created requisitionLine

In URL:

http://localhost:8080/api/requisitionLines/7b3aba26-e178-4b5c-b15c-a5b953c7e9cb?access_token=faaa21bc-3a09-4590-9f7b-91b3238fdcfe

Method: Get


beginningBalance value should be the same as  value stockInHand set in first created requisitionLine

OpenLMIS: the global initiative for powerful LMIS software