1467: Notify via email requisition creator upon convert to order

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.  

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.

Method: POST

Body:

{

    "username": "Tester",

    "newPassword": "password1"

}

 

 

3

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

Method: POST

 

4

 Check If creatorId is assigned properly.

Method: GET


 The id of creator is assigned properly.

 

5

 Try to change the creatorId of requisition.

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": [

OpenLMIS: the global initiative for powerful LMIS software