760: Create a basic requisition

 Test Case #:760

Test Case Name: Create a basic requisition

System: OpenLMIS

Subsystem:requisition

Test case designed by: Paulina Borowa

Design Date:26.07.2016

Short description: Verify that: -Create a basic requisition

-upon submission the requisition status changes to "submitted"

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       


 Step

Action

Expected system response

Comment

1

                  Initiate requisition:

Method: POST

URL: requisition/initiate

program:

10845cb9-d365-4aaa-badd-b4fa39c6a26a

facility: e6799d64-d10d-4011-b8c2-0e4d4a3f65ce

                                                                                        

        Requisition is created and associated with program, facility schedule and period.  Date of creation is included, status INITIATED appears. 

           
                                                             

                                               

2

Get requisition

Method: GET

URL: requisitions/id/

id: db69889b-180e-4643-b485-240857ff6984

access_token:  5e16b922-266b-4afc-ab93-5c6fe13875ba

The details of requisition are displayed properly.


3

Submit requisition

Method: POST

URL: requisitions/id/submit

id: db69889b-180e-4643-b485-240857ff6984

access_token:  5e16b922-266b-4afc-ab93-5c6fe13875ba

Requisition has been submitted. The status of requisition has been changed to "SUBMITTED".

Its not possible to submit the requisition when stockOnHand and totalConsumedQuantity are invalid.




4

Authorize requisition.

Method: POST

URL: requisitions/id/authorize

id: db69889b-180e-4643-b485-240857ff6984

access_token:  5e16b922-266b-4afc-ab93-5c6fe13875ba

Requisition has been authorized.


5

Approve requisition.

Method: POST

URL: requisitions/id/approve

id: db69889b-180e-4643-b485-240857ff6984

access_token:  5e16b922-266b-4afc-ab93-5c6fe13875ba


Requisition has been approved.

When approvedQuantity is not entered, requisition can not be approved.

6

Get requsiition ready for Convert To order.

Method: GET

URL: requisitions/requisitions-for-convert



7

Update requisition:

Method: PUT

URL: requisitions/id

Body:

{
  "id": "db69889b-180e-4643-b485-240857ff6984",
  "createdDate": [
    2016,
    10,
    28,
    7,
    34,
    37,
    679000000
  ],
  "requisitionLineItems": [
    {
      "id": "d288dabd-d674-45bb-8d2c-e2fa5e2184ec",
      "orderableProduct": {
        "id": "2400e410-b8dd-4954-b1c0-80d8a8e785fc",
        "productCode": "C1",
        "name": "Acetylsalicylic Acid",
        "programs": [
          {
            "programId": "10845cb9-d365-4aaa-badd-b4fa39c6a26a",
            "productId": "2400e410-b8dd-4954-b1c0-80d8a8e785fc",
            "productCategoryId": "6805dd74-ec00-4697-9a5d-5b78414fcaf6",
            "productCategoryDisplayName": "Antibiotics",
            "productCategoryDisplayOrder": 1,
            "active": true,
            "fullSupply": true,
            "displayOrder": 1,
            "maxMonthsOfStock": 1000,
            "dosesPerMonth": 10
          }
        ]
      },
      "beginningBalance": 5,
      "totalReceivedQuantity": 5,
      "totalLossesAndAdjustments": 0,
      "stockOnHand": null,
      "requestedQuantity": 5,
      "totalConsumedQuantity": 5,
      "requestedQuantityExplanation": "5",
      "remarks": null,
      "approvedQuantity": 2,
      "stockAdjustments": []
    },
    {
      "id": "70d9bd36-a575-4246-98c8-3dc7f7acfa2a",
      "orderableProduct": {
        "id": "c9e65f02-f84f-4ba2-85f7-e2cb6f0989af",
        "productCode": "C4",
        "name": "Streptococcus Pneumoniae Vaccine II",
        "programs": [
          {
            "programId": "10845cb9-d365-4aaa-badd-b4fa39c6a26a",
            "productId": "c9e65f02-f84f-4ba2-85f7-e2cb6f0989af",
            "productCategoryId": "16173fd0-f439-4222-931e-91c413a495c3",
            "productCategoryDisplayName": "Vaccines",
            "productCategoryDisplayOrder": 5,
            "active": true,
            "fullSupply": true,
            "displayOrder": 4,
            "maxMonthsOfStock": 30,
            "dosesPerMonth": 1
          }
        ]
      },
      "beginningBalance": 3,
      "totalReceivedQuantity": 3,
      "totalLossesAndAdjustments": 0,
      "stockOnHand": null,
      "requestedQuantity": 3,
      "totalConsumedQuantity": 3,
      "requestedQuantityExplanation": "4",
      "remarks": null,
      "approvedQuantity": 2,
      "stockAdjustments": []
    }
  ],
  "comments": [],
  "facility": {
    "id": "e6799d64-d10d-4011-b8c2-0e4d4a3f65ce",
    "code": "HC01",
    "name": "Comfort Health Clinic",
    "description": null,
    "active": true,
    "goLiveDate": null,
    "goDownDate": null,
    "comment": null,
    "enabled": true,
    "openLmisAccessible": true,
    "supportedPrograms": [
      {
        "id": "dce17f2e-af3e-40ad-8e00-3496adef44c3",
        "code": "PRG001",
        "name": "Family Planing",
        "description": null,
        "active": true,
        "periodsSkippable": true,
        "showNonFullSupplyTab": null
      },
      {
        "id": "10845cb9-d365-4aaa-badd-b4fa39c6a26a",
        "code": "PRG002",
        "name": "Essential Meds",
        "description": null,
        "active": true,
        "periodsSkippable": false,
        "showNonFullSupplyTab": null
      }
    ],
    "geographicZone": {
      "id": "bf2b810b-cdbf-48b2-b569-149b3cf42387",
      "code": "M-So-Bal-Bal",
      "name": "Balaka",
      "level": {
        "id": "90e35999-a64f-4312-ba8f-bc13a1311c75",
        "code": "City",
        "name": null,
        "levelNumber": 4
      },
      "parent": null
    },
    "operator": {
      "id": "9456c3e9-c4a6-4a28-9e08-47ceb16a4121",
      "code": "moh",
      "name": "Ministry of Health"
    },
    "type": {
      "id": "ac1d268b-ce10-455f-bf87-9c667da8f060",
      "code": "HC",
      "name": "Health Center",
      "description": null,
      "displayOrder": 1,
      "active": true
    }
  },
  "program": {
    "id": "10845cb9-d365-4aaa-badd-b4fa39c6a26a",
    "code": "PRG002",
    "name": "Essential Meds",
    "description": null,
    "active": true,
    "periodsSkippable": false,
    "showNonFullSupplyTab": null
  },
  "processingPeriod": {
    "id": "c5012ddf-b145-4eee-9640-b2cbf4f2da85",
    "processingSchedule": {
      "id": "057921bd-1841-4748-8523-dbe5ebb58368",
      "code": "SCH002",
      "description": null,
      "modifiedDate": null,
      "name": "Quarterly"
    },
    "name": "Q2",
    "description": null,
    "startDate": [
      2016,
      4,
      1
    ],
    "endDate": [
      2016,
      6,
      30
    ]
  },
  "status": "AUTHORIZED",
  "emergency": true,
  "supplyingFacility": null,
  "supervisoryNode": null
}


Requisition has been updated. The approved Quantity was entered,


8

                      



9


10


11


12



OpenLMIS: the global initiative for powerful LMIS software