812:Configure Beginning Balance attribute

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:

Method: Post:

Example Body:

{

"code":"facility"

}

Status 201 created,

 

3

Create geographicLevel

In URL:

Method: Post:

Example Body:

{

"code":"GL",

"levelNumber":"11"

}

Status 201 created,

 

4

Create geographicZones

In URL:

Method: Post:

Example Body:

{

"code":"GeoZon2",

"name":"test"

}

Status 201 created,

 

5

Create schedules

In URL:

Method: Post:

Example Body:

{

"code": "codecode121",

"name": "scheduleNamee"

}

Status 201 created,

 

6

Create productCategories

In URL:

Method: Post:

Example Body:

{

"code":"kateg91",

"name":"testy19y",

"displayOrder":"8"

}

Status 201 created,

 

7

Create programs

In URL:

Method: Post:

Example Body:

{

"code":"programs3"

}

Status 201 created,

 

8

                       

Create requisitionTemplates

In URL:

Method: Post:

Example Body:

{

"columnsMap":

{"beginningBalance":

{"name":"beginningBalance",

"label":"beginningBalance",

"displayOrder":1,

"isDisplayed":true,

"isDisplayRequired":true,

"canChangeOrder":true,

"canBeChangedByUser":true,

"source":"CALCULATED"}

}

}


                         

Status 201 created,

 

9

Create facilities

In URL:

Method: Post:

Example Body:

{

"code":"facilitiees21",

"active":true,

"enabled":false

}

Status 201 created,

 

10

Create products

In URL:

Method: Post:

Example Body:

{

"code":"product1d",

"primaryName":"text",

"dispensingUnit":"1",

"dosesPerDispensingUnit":"12",

"packSize":"1",

"packRoundingThreshold":"3",

"roundToZero":true,

"active":true,

"fullSupply":true,

"tracer":true,

}

Status 201 created,

 

11

Create periods

In URL:

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:

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:

Method: Post:

Example Body:

{

"status":"SUBMITTED"

}

Status 201 created,

 

14

Create RequisitionLine entity

In URL:

Method: Post:

Example Body:

{

"stockInHand":"22",

}

Status 201 created,

Need to add value to "stockInHand",

Use requisition containing periods with earlier date.

 

15

Create another RequisitionLine

In URL:

Method: Post:

Example Body:

{

}

Status 201 created,

The same product entity as previously created RequisitionLine

16

Create another requisition entity

In URL:

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:

Method: Get

 

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

OpenLMIS: the global initiative for powerful LMIS software