1301: Admin UI to Configure Requisition Templates

Test Case #: 1301


Test Case Name: Admin UI to Configure Requisition Templates

System: openLMIS

Subsystem: blue

Test case designed by: Lucyna Laska

Design Date:06.12.2016

Short description

As an implementor/admin, I want to configure the requisition template(s) for my program(s) with a user-friendly UI so that my RnRs will be set up right for each program.

This ticket has sub-tasks to implement two new pages within the Requisition Ref UI.
(1) List of requisition templates (located in the top navigation at "Administration" > "Configure" > "R & R Template"
(2) Edit requisition template page (accessible from the list of requisition templates only)

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       



Step

Action

Expected system response

Comment

1

  Assign User a role "MANAGE_REQUISITION_TEMPLATES". 

URL:  http://10.222.17.134/api/users?access_token=1bdf13b8-ab12-48f4-b836-f0478fa1f34d

Method: PUT

Body:

 {
         "id": "a337ec45-31a0-4f2b-9b2e-a105c4b669bb",
    "username": "administrator",
    "firstName": "Admin",
    "lastName": "Admin",
    "email": "administrator@openlmis.org",
    "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": "warehouse",
        "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 Planing",
          "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": "HC01"
      },
      {
        "roleId": "a439c5de-b8aa-11e6-80f5-76304dec7eb7"
      }
    ]

  }

                                                                                

                                                                                                                            

   Add right:

               URL: http://10.222.17.134/api/rights?access_token=c276478e-a668-43d6-b4cd-b68a8e2ef378

     Method: PUT

Body:

  {

    "id": "8816edba-b8a9-11e6-80f5-76304dec7eb7",

    "name": "MANAGE_REQUISITION_TEMPLATES",

    "type": "GENERAL_ADMIN",

    "attachments": []

  },


Add role:

URL: http://10.222.17.134/api/roles?access_token=c276478e-a668-43d6-b4cd-b68a8e2ef378

Method: POST

Body:

  {

    "id": "a439c5de-b8aa-11e6-80f5-76304dec7eb7",

    "name": "Admin",

    "rights": [

      {

        &qu