1467: Notify via email requisition creator upon convert to order

Test Case #: 1467


Test Case Name: Notify via email requisition creator upon convert to order

System: openLMIS

Subsystem: blue

Test case designed by: Lucyna Laska

Design Date:18.01.2017

Short description

  • a requisition should have a new field that contain information about who create it.
  • a user should not be able to update this field in the future.
  • when the requisition is converted to an order creator should get an notification via email.

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

 

 

Step

Action

Expected system response

Comment

1

              Create a User(Tester) and assigned proper role for creating a requisition.  

  URL: http://10.222.17.134/api/requisitions/initiate?program=dce17f2e-af3e-40ad-8e00-3496adef44c3&facility=e6799d64-d10d-4011-b8c2-0e4d4a3f65ce&emergency=false&access_token=0aae7730-6545-409d-8900-a74c139dc559

Method: PUT

Body:

 {
    "username": "Tester",
    "firstName": "Quality",
    "lastName": "First",
    "email": "testowysoldevelo@gmail.com",
    "timezone": "CET",
    "homeFacility": {
      "code": "HC01",
      "name": "Comfort Health Clinic",
      "geographicZone": {
        "code": "M-So-Bal-Bal",
        "name": "Balaka",
        "level": {
          "code": "City",
          "levelNumber": 4,
          "id": "90e35999-a64f-4312-ba8f-bc13a1311c75"
        },
        "latitude": -14.99,
        "longitude": 34.92,
        "id": "bf2b810b-cdbf-48b2-b569-149b3cf42387"
      },
      "type": {
        "code": "health_center",
        "name": "Health Center",
        "displayOrder": 1,
        "active": true,
        "id": "ac1d268b-ce10-455f-bf87-9c667da8f060"
      },
      "operator": {
        "code": "moh",
        "name": "Ministry of Health",
        "displayOrder": 1,
        "id": "9456c3e9-c4a6-4a28-9e08-47ceb16a4121"
      },
      "active": true,
      "enabled": true,
      "openLmisAccessible": true,
      "supportedPrograms": [
        {
          "id": "dce17f2e-af3e-40ad-8e00-3496adef44c3",
          "code": "PRG001",
          "name": "Family Planning",
          "programActive": true,
          "periodsSkippable": true,
          "showNonFullSupplyTab": true,
          "supportActive": true
        },
        {
          "id": "10845cb9-d365-4aaa-badd-b4fa39c6a26a",
          "code": "PRG002",
          "name": "Essential Meds",
          "programActive": true,
          "periodsSkippable": false,
          "showNonFullSupplyTab": false,
          "supportActive": true
        }
      ],
      "id": "e6799d64-d10d-4011-b8c2-0e4d4a3f65ce"
    },
    "verified": true,
    "active": true,
    "loginRestricted": false,
    "roleAssignments": [
      {
        "roleId": "d30a2fbb-51d9-49ad-90fe-fb405470a439",
        "programCode": "PRG002",
        "supervisoryNodeCode": "N1"
      },
      {
        "roleId": "d30a2fbb-51d9-49ad-90fe-fb405470a439",
        "programCode": "PRG001"
      },
      {
        "roleId": "d30a2fbb-51d9-49ad-90fe-fb405470a439",
        "programCode": "PRG002"
      },
      {
        "roleId": "d30a2fbb-51d9-49ad-90fe-fb405470a439",
        "programCode": "PRG001",
        "supervisoryNodeCode": "N1"
      },
      {
        "roleId": "185db8f7-ee35-44d0-8b40-6de12489ae77",
        "warehouseCode": "W01"
      },
      {
        "roleId": "a439c5de-b8aa-11e6-80f5-76304dec7eb7"
      }
    ]
  }

                                                                                                                            

                                                 

2

Change password for user.

URL:  http://10.222.17.134/api/users/passwordReset?access_token=916b77d1-c426-4dca-9470-bc809510c8f9

Method: POST

Body:

{

    "username": "Tester",

    "newPassword": "password1"

}

 

 

3

 As a new user (Tester), try to initiate the requisition.

URL: http://10.222.17.134/api/requisitions/initiate?program=dce17f2e-af3e-40ad-8e00-3496adef44c3&facility=e6799d64-d10d-4011-b8c2-0e4d4a3f65ce&emergency=false&access_token=1139120e-8fcd-41c8-b2be-27a8571859b9

Method: POST


 

 

4

 Check If creatorId is assigned properly.

URL: http://10.222.17.134/api/users/b10dc183-effb-43b5-ad03-7bdee239e72c?access_token=916b77d1-c426-4dca-9470-bc809510c8f9

Method: GET


 The id of creator is assigned properly.

 

5

 Try to change the creatorId of requisition.

URL:  http://10.222.17.134/api/requisitions/c1eac4bb-c4d7-446d-ad14-8ab97ae358fa?access_token=6c66b4fe-f5e9-492b-968d-6279f41d787b

Method: PUT

Body:

{

  "id": "459f4d38-9d40-457e-b519-6326e7799e03",

  "createdDate": [

    2017,

    1,

    18,

    9,

    20,

    33,

    491000000

  ],

  "creatorId": "a337ec45-31a0-4f2b-9b2e-a105c4b669bb",

  "requisitionLineItems": [

    {

      "id": "2b1c0534-452a-4fd7-9c7c-08ece35b6881",

      "orderableProduct": {

        "id": "d602d0c6-4052-456c-8ccd-61b4ad77bece",

        "productCode": "C100",

        "name": "Levora",

        "packSize": 84,

        "packRoundingThreshold": 42,

        "roundToZero": false,

        "programs": [

          {

            "programId": "dce17f2e-af3e-40ad-8e00-3496adef44c3",

            "productId": "d602d0c6-4052-456c-8ccd-61b4ad77bece",

            "productCategoryId": "15b8ef1f-a5d6-42dd-95bf-bb68a4504e82",

            "productCategoryDisplayName": "Oral Contraceptive",

            "productCategoryDisplayOrder": 6,

            "active": true,

            "fullSupply": true,

            "displayOrder": 1,

            "maxMonthsOfStock": 1000,

            "dosesPerMonth": 1,

            "pricePerPack": null

          }

        ],

        "dispensable": {

          "dispensingUnit": "10 tab strip"

        }

      },

      "beginningBalance": 0,

      "totalReceivedQuantity": 0,

      "totalLossesAndAdjustments": null,

      "stockOnHand": null,

      "requestedQuantity": null,

      "totalConsumedQuantity": null,

      "requestedQuantityExplanation": null,

      "remarks": null,

      "approvedQuantity": null,

      "totalStockoutDays": null,

      "total": null,

      "packsToShip": null,

      "pricePerPack": "0.00",

      "numberOfNewPatientsAdded": 0,

      "totalCost": null,

      "skipped": false,

      "adjustedConsumption": null,

      "previousAdjustedConsumptions": [],

      "averageConsumption": null,

      "maxMonthsOfStock": 1000,

      "maximumStockQuantity": null,

      "calculatedOrderQuantity": null,

      "stockAdjustments": []

    },

    {

      "id": "a291fa2e-d922-4ad9-9149-82a50add367b",

      "orderableProduct": {

        "id": "23819693-0670-4c4b-b400-28e009b86b51",

        "productCode": "C200",

        "name": "Ortho-Novum",

        "packSize": 63,

        "packRoundingThreshold": 31,

        "roundToZero": false,

        "programs": [

          {

            "programId": "dce17f2e-af3e-40ad-8e00-3496adef44c3",

            "productId": "23819693-0670-4c4b-b400-28e009b86b51",

            "productCategoryId": "15b8ef1f-a5d6-42dd-95bf-bb68a4504e82",

            "productCategoryDisplayName": "Oral Contraceptive",

            "productCategoryDisplayOrder": 6,

            "active": true,

            "fullSupply": true,

            "displayOrder": 2,

            "maxMonthsOfStock": 1000,

            "dosesPerMonth": 1,

            "pricePerPack": "15.94"

          }

        ],

        "dispensable": {

          "dispensingUnit": "each"

        }

      },

      "beginningBalance": 0,

      "totalReceivedQuantity": 0,

      "totalLossesAndAdjustments": null,

      "stockOnHand": null,

      "requestedQuantity": null,

      "totalConsumedQuantity": null,

      "requestedQuantityExplanation": null,

      "remarks": null,

      "approvedQuantity": null,

      "totalStockoutDays": null,

      "total": null,

      "packsToShip": null,

      "pricePerPack": "15.94",

      "numberOfNewPatientsAdded": 0,

      "totalCost": null,

      "skipped": false,

      "adjustedConsumption": null,

      "previousAdjustedConsumptions": [],

      "averageConsumption": null,

      "maxMonthsOfStock": 1000,

      "maximumStockQuantity": null,

      "calculatedOrderQuantity": null,

      "stockAdjustments": []

    },

    {

      "id": "270be54e-60aa-4fa0-a211-b4645597232c",

      "orderableProduct": {

        "id": "bfde33c3-83f1-4feb-a27c-842852f66b71",

        "productCode": "C400",

        "name": "Male Condom",

        "packSize": 1,

        "packRoundingThreshold": 0,

        "roundToZero": false,

        "programs": [

          {

            "programId": "dce17f2e-af3e-40ad-8e00-3496adef44c3",

            "productId": "bfde33c3-83f1-4feb-a27c-842852f66b71",

            "productCategoryId": "3bfe0282-732b-4ce8-b4f9-aa7ffb297758",

            "productCategoryDisplayName": "Barrier Method",

            "productCategoryDisplayOrder": 7,

            "active": true,

            "fullSupply": true,

            "displayOrder": 3,

            "maxMonthsOfStock": 20,

            "dosesPerMonth": 1,

            "pricePerPack": "25.46"

          }

        ],

        "dispensable": {

          "dispensingUnit": "each"

        }

      },

      "beginningBalance": 0,

      "totalReceivedQuantity": 0,

      "totalLossesAndAdjustments": null,

      "stockOnHand": null,

      "requestedQuantity": null,

      "totalConsumedQuantity": null,

      "requestedQuantityExplanation": null,

      "remarks": null,

      "approvedQuantity": null,

      "totalStockoutDays": null,

      "total": null,

      "packsToShip": null,

      "pricePerPack": "25.46",

      "numberOfNewPatientsAdded": 0,

      "totalCost": null,

      "skipped": false,

      "adjustedConsumption": null,

      "previousAdjustedConsumptions": [],

      "averageConsumption": null,

      "maxMonthsOfStock": 500,

      "maximumStockQuantity": null,

      "calculatedOrderQuantity": null,

      "stockAdjustments": []

    },

    {

      "id": "95dc64fc-2a03-47d9-be95-6c53055d5e9e",

      "orderableProduct": {

        "id": "7b9b66e0-f008-4c38-93ec-7a5f4868cca9",

        "productCode": "C600",

        "name": "Levonorgestrel ",

        "packSize": 1,

        "packRoundingThreshold": 0,

        "roundToZero": false,

        "programs": [

          {

            "programId": "dce17f2e-af3e-40ad-8e00-3496adef44c3",

            "productId": "7b9b66e0-f008-4c38-93ec-7a5f4868cca9",

            "productCategoryId": "06606981-67cc-42d1-87ed-21f22fb0ea58",

            "productCategoryDisplayName": "Implantable Contraceptive",

            "productCategoryDisplayOrder": 8,

            "active": true,

            "fullSupply": true,

            "displayOrder": 5,

            "maxMonthsOfStock": 20,

            "dosesPerMonth": 1,

            "pricePerPack": "5.10"

          }

        ],

        "dispensable": {

          "dispensingUnit": "10 tab strip"

        }

      },

      "beginningBalance": 0,

      "totalReceivedQuantity": 0,

      "totalLossesAndAdjustments": null,

      "stockOnHand": null,

      "requestedQuantity": null,

      "totalConsumedQuantity": null,

      "requestedQuantityExplanation": null,

      "remarks": null,

      "approvedQuantity": null,

      "totalStockoutDays": null,

      "total": null,

      "packsToShip": null,

      "pricePerPack": "5.10",

      "numberOfNewPatientsAdded": 0,

      "totalCost": null,

      "skipped": false,

      "adjustedConsumption": null,

      "previousAdjustedConsumptions": [],

      "averageConsumption": null,

      "maxMonthsOfStock": 500,

      "maximumStockQuantity": null,

      "calculatedOrderQuantity": null,

      "stockAdjustments": []

    }

  ],

  "draftStatusMessage": null,

  "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 Planning",

        "description": null,

        "programActive": true,

        "periodsSkippable": true,

        "showNonFullSupplyTab": true,

        "supportActive": true,

        "supportStartDate": null

      },

      {

        "id": "10845cb9-d365-4aaa-badd-b4fa39c6a26a",

        "code": "PRG002",

        "name": "Essential Meds",

        "description": null,

        "programActive": true,

        "periodsSkippable": false,

        "showNonFullSupplyTab": false,

        "supportActive": true,

        "supportStartDate": 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": "health_center",

      "name": "Health Center",

      "description": null,

      "displayOrder": 1,

      "active": true

    }

  },

  "program": {

    "id": "dce17f2e-af3e-40ad-8e00-3496adef44c3",

    "code": "PRG001",

    "name": "Family Planning",

    "description": null,

    "active": true,

    "periodsSkippable": true,

    "showNonFullSupplyTab": true

  },

  "processingPeriod": {

    "id": "516ac930-0d28-49f5-a178-64764e22b236",

    "processingSchedule": {

      "id": "9c15bd6e-3f6b-4b91-b53a-36c199d35eac",

      "code": "SCH001",

      "description": null,

      "modifiedDate": [

        2015,

        12,

        31,

        23,

        59,

        59

      ],

      "name": "Monthly"

    },

    "name": "Jan2017",

    "description": null,

    "startDate": [

      2017,

      1,

      1

    ],

    "endDate": [

      2017,

      1,

      31

    ],

    "durationInMonths": 1

  },

  "status": "INITIATED",

  "emergency": false,

  "supplyingFacility": null,

  "supervisoryNode": null,

  "template": "5a268780-fafd-4243-9551-5c7daa824913",

  "previousRequisitions": []

}

It's not possible to change the Id of initiator.


 

 

6

 Log in as other user and submit/authorize/approve the requisition.
  • requisition has been submitted successfully


  • requisition has been authorized successfully


  • requisition has been approved successfully

 

 

7

 Convert the requisition to order.

 

 

8

                     The user who initiated the requisition should check if the email has been sent with information that the requisition is converted to an order.                          


 

 

9



10Log in as other user (e.g. Administrator) and check submit/authorize/approve the requisitions.


  • requisition has been submitted successfully


  • requisition has been authorized successfully


  • requisition has been approved successfully


11

As a Administrator user, try to convert those requisitions to an orders.



12

The user who initiated the requisitino should check if the email has been sent with information that the requisition is converted to an order. 




User received two emails.



13As a Tester user, initiate two Emergency requisitions and submit/authorize/approve them. Then, convert requisitions to orders and check, if two emails has been sent to user.

User received two emails with information that his/her requisitions has been converted to orders. In addition, the emails with information about creating the orders (ID's, status) also has been sent to that user.


 

 

Post – conditions:

OpenLMIS: the global initiative for powerful LMIS software