862: Revise relation annotations between models

Test Case #:862

Test Case Name: Revise relation annotations between models

System:

Subsystem:

Test case designed by:

Design Date:08.09.2016

Short description

The task is to look for model relations and add/modify cascade parameters where those could be useful.
For example, persisting order lines along with order could be useful.
Also, keep in mind our recent issue caused by overused CascadeType.PERSIST ( OLMIS-845 - Getting issue details... STATUS )

Acceptance criteria

  • Investigate adding more cascade types to model relations, focus on Persist and Remove.
  • Remove excessive cascade types from model relations.
  • If necessary, adjust tests to work properly with the new changes.

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       


Step

Action

Expected system response

Comment

1

Create everything what is needed for an Order except OrderLines.     

In URL: http://localhost:8080/api/orders/?access_token=09eeb73f-f274-46ce-8576-9579b21d2ed8

Method: Post

Body

{
    "id": "1e6031d5-b3e2-4a9b-9365-26b26259b873",
    "requisition": null,
    "createdDate": [
      2016,
      9,
      7,
      9,
      36,
      9,
      894000000
    ],
    "createdBy": {
      "id": "599f4c95-4fe9-423f-ac26-c0cf8ee0f5b7",
      "username": "UserName12",
      "firstName": "Name2F",
      "lastName": "Last2N",
      "email": "testowesoldeveolo@gmail.com",
      "timezone": "CTM",
      "supervisedNode": null,
      "homeFacility": null,
      "verified": true,
      "active": true,
      "restrictLogin": false,
      "roles": []
    },
    "program": {
      "id": "55915c3e-98a6-4ad9-9100-5403ad173c00",
      "code": "qwqqq1",
      "name": "aName1",
      "description": null,
      "active": null,
      "periodsSkippable": false,
      "showNonFullSupplyTab": null
    },
    "requestingFacility": {
      "id": "9db9b475-7475-4366-9b5a-e8ec4776d3e4",
      "code": "FAC001123",
      "name": "Facility Active Enabled123",
      "description": null,
      "geographicZone": {
        "id": "690209af-7535-4095-ae5f-318d05b91be1",
        "code": "GeoZon2",
        "name": "test",
        "level": {
          "id": "52f2de58-684b-48b3-be9a-562a6ad6db99",
          "code": "Gl2",
          "name": null,
          "levelNumber": 11
        },
        "catchmentPopulation": null,
        "latitude": null,
        "longitude": null
      },
      "type": {
        "id": "e81d0096-d95d-4866-aa35-18d772c7ad3e",
        "code": "facility1",
        "name": "test",
        "description": null,
        "displayOrder": null,
        "active": null
      },
      "operator": null,
      "active": true,
      "goLiveDate": null,
      "goDownDate": null,
      "comment": null,
      "enabled": true,
      "openLmisAccessible": true,
      "supportedPrograms": []
    },
    "receivingFacility": {
      "id": "136ad212-db83-4192-bebe-ea555e68eceb",
      "code": "FAC00112",
      "name": "Facility Active Enabled12",
      "description": null,
      "geographicZone": {
        "id": "690209af-7535-4095-ae5f-318d05b91be1",
        "code": "GeoZon2",
        "name": "test",
        "level": {
          "id": "52f2de58-684b-48b3-be9a-562a6ad6db99",
          "code": "Gl2",
          "name": null,
          "levelNumber": 11
        },
        "catchmentPopulation": null,
        "latitude": null,
        "longitude": null
      },
      "type": {
        "id": "e81d0096-d95d-4866-aa35-18d772c7ad3e",
        "code": "facility1",
        "name": "test",
        "description": null,
        "displayOrder": null,
        "active": null
      },
      "operator": null,
      "active": true,
      "goLiveDate": null,
      "goDownDate": null,
      "comment": null,
      "enabled": true,
      "openLmisAccessible": true,
      "supportedPrograms": []
    },
    "supplyingFacility": {
      "id": "74a4b634-482b-443e-b829-f9eab3ff98d2",
      "code": "FAC0011",
      "name": "Facility Active Enabled1",
      "description": null,
      "geographicZone": {
        "id": "690209af-7535-4095-ae5f-318d05b91be1",
        "code": "GeoZon2",
        "name": "test",
        "level": {
          "id": "52f2de58-684b-48b3-be9a-562a6ad6db99",
          "code": "Gl2",
          "name": null,
          "levelNumber": 11
        },
        "catchmentPopulation": null,
        "latitude": null,
        "longitude": null
      },
      "type": {
        "id": "e81d0096-d95d-4866-aa35-18d772c7ad3e",
        "code": "facility1",
        "name": "test",
        "description": null,
        "displayOrder": null,
        "active": null
      },
      "operator": null,
      "active": true,
      "goLiveDate": null,
      "goDownDate": null,
      "comment": null,
      "enabled": true,
      "openLmisAccessible": true,
      "supportedPrograms": []
    },
    "orderCode": "ORD1",
    "status": "RECEIVED",
    "quotedCost": 1000000,
     "orderLines": [
      {
        "orderLinesId": 1,
        "id": "fdda59b4-dd13-4e64-b118-80b607703cea",
  "order": "1e6031d5-b3e2-4a9b-9365-26b26259b873",
        "product": {
          "id": "1752b457-0a4b-4de0-bf94-5a6a8002427e",
          "code": "productCode",
          "primaryName": "productName",
          "dispensingUnit": "1",
          "dosesPerDispensingUnit": 1,
          "packSize": 1,
          "packRoundingThreshold": 1,
          "roundToZero": true,
          "active": true,
          "fullSupply": true,
          "tracer": true,
          "productCategory": {
            "id": "3c840e6c-a2e6-482f-b794-90379fcbfe00",
            "code": "categorycode",
            "name": "categoryname",
            "displayOrder": 32
          }
        },
        "orderedQuantity": 300,
        "filledQuantity": 100
      }
    ]
  }
]

Status 201 created  



                                                 

2

Create an Order together with OrderLines.
In URL: http://localhost:8080/api/orderLines?access_token=961a251c-becc-4452-ae29-41b517ab02ba

Method: Post

Body

{
    "id": "00000000-0000-0000-0000-000000000001",
    "order": {
  "id": "1e6031d5-b3e2-4a9b-9365-26b26259b873",
  "requisition": null,
  "createdDate": [
    2016,
    9,
    7,
    9,
    36,
    9,
    894000000
  ],
  "createdBy": {
    "id": "599f4c95-4fe9-423f-ac26-c0cf8ee0f5b7",
    "username": "UserName12",
    "firstName": "Name2F",
    "lastName": "Last2N",
    "email": "testowesoldeveolo@gmail.com",
    "timezone": "CTM",
    "supervisedNode": null,
    "homeFacility": null,
    "verified": true,
    "active": true,
    "restrictLogin": false,
    "roles": null
  },
  "program": {
    "id": "55915c3e-98a6-4ad9-9100-5403ad173c00",
    "code": "qwqqq1",
    "name": "aName1",
    "description": null,
    "active": null,
    "periodsSkippable": false,
    "showNonFullSupplyTab": null
  },
  "requestingFacility": {
    "id": "9db9b475-7475-4366-9b5a-e8ec4776d3e4",
    "code": "FAC001123",
    "name": "Facility Active Enabled123",
    "description": null,
    "geographicZone": {
      "id": "690209af-7535-4095-ae5f-318d05b91be1",
      "code": "GeoZon2",
      "name": "test",
      "level": {
        "id": "52f2de58-684b-48b3-be9a-562a6ad6db99",
        "code": "Gl2",
        "name": null,
        "levelNumber": 11
      },
      "catchmentPopulation": null,
      "latitude": null,
      "longitude": null
    },
    "type": {
      "id": "e81d0096-d95d-4866-aa35-18d772c7ad3e",
      "code": "facility1",
      "name": "test",
      "description": null,
      "displayOrder": null,
      "active": null
    },
    "operator": null,
    "active": true,
    "goLiveDate": null,
    "goDownDate": null,
    "comment": null,
    "enabled": true,
    "openLmisAccessible": true,
    "supportedPrograms": null
  },
  "receivingFacility": {
    "id": "136ad212-db83-4192-bebe-ea555e68eceb",
    "code": "FAC00112",
    "name": "Facility Active Enabled12",
    "description": null,
    "geographicZone": {
      "id": "690209af-7535-4095-ae5f-318d05b91be1",
      "code": "GeoZon2",
      "name": "test",
      "level": {
        "id": "52f2de58-684b-48b3-be9a-562a6ad6db99",
        "code": "Gl2",
        "name": null,
        "levelNumber": 11
      },
      "catchmentPopulation": null,
      "latitude": null,
      "longitude": null
    },
    "type": {
      "id": "e81d0096-d95d-4866-aa35-18d772c7ad3e",
      "code": "facility1",
      "name": "test",
      "description": null,
      "displayOrder": null,
      "active": null
    },
    "operator": null,
    "active": true,
    "goLiveDate": null,
    "goDownDate": null,
    "comment": null,
    "enabled": true,
    "openLmisAccessible": true,
    "supportedPrograms": null
  },
  "supplyingFacility": {
    "id": "74a4b634-482b-443e-b829-f9eab3ff98d2",
    "code": "FAC0011",
    "name": "Facility Active Enabled1",
    "description": null,
    "geographicZone": {
      "id": "690209af-7535-4095-ae5f-318d05b91be1",
      "code": "GeoZon2",
      "name": "test",
      "level": {
        "id": "52f2de58-684b-48b3-be9a-562a6ad6db99",
        "code": "Gl2",
        "name": null,
        "levelNumber": 11
      },
      "catchmentPopulation": null,
      "latitude": null,
      "longitude": null
    },
    "type": {
      "id": "e81d0096-d95d-4866-aa35-18d772c7ad3e",
      "code": "facility1",
      "name": "test",
      "description": null,
      "displayOrder": null,
      "active": null
    },
    "operator": null,
    "active": true,
    "goLiveDate": null,
    "goDownDate": null,
    "comment": null,
    "enabled": true,
    "openLmisAccessible": true,
    "supportedPrograms": null
  },
  "orderCode": "ORD1",
  "status": "RECEIVED",
  "quotedCost": 1000000,
  "orderLines": null
},
    "product": {
    "id": "1752b457-0a4b-4de0-bf94-5a6a8002427e",
    "code": "productCode",
    "primaryName": "productName",
    "dispensingUnit": "1",
    "dosesPerDispensingUnit": 1,
    "packSize": 1,
    "packRoundingThreshold": 1,
    "roundToZero": "true",
    "active": "true",
    "fullSupply": "true",
    "tracer": "true",
    "productCategory": { "id": "3c840e6c-a2e6-482f-b794-90379fcbfe00" }
},
    "orderedQuantity": 300,
    "filledQuantity": 100
}


 

Status 201 created


3


Check if the Order and its OrderLines exist.

In URL:

http://localhost:8080/api/orders/?access_token=09eeb73f-f274-46ce-8576-9579b21d2ed8

Method: Get


Status 200 OK


4

 Remove the Order. Check if the OrderLines were also removed.

In URL:

http://localhost:8080/api/orders/1e6031d5-b3e2-4a9b-9365-26b26259b873//?access_token=09eeb73f-f274-46ce-8576-9579b21d2ed8

Method: Delete

Check:

In URL:

http://localhost:8080/api/orderLines/?access_token=09eeb73f-f274-46ce-8576-9579b21d2ed8

Method: Get

In URL:

http://localhost:8080/api/orders/?access_token=09eeb73f-f274-46ce-8576-9579b21d2ed8

Method: Get


Order and its OrderLines are deleted.

Status 200 OK,

Empty list of Orders and OrderLines


5

Create everything what is needed for a ProofOfDelivery except ProofOfDeliveryLines.

In URL:

 http://localhost:8080/api/proofOfDeliveries/?access_token=7d5fcd3c-f37f-4da9-a726-88e8b59d40ea

Body:

{

"order": {

"id": "d2ffff07-258f-4ac5-9906-6059be4fc483",

"requisition": {

"id": "26744791-dd00-4631-99a5-09d99a782bf2",

"requisitionLines": [

],

"facility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"program": {

"id": "96e4acf3-f256-44ff-ba25-e0178d199aa3",

"code": "programcode",

"name": "programname",

"description": "abc",

"periodsSkippable": true

},

"processingPeriod": {

"id": "c43682f4-b1f4-4d34-925a-27104fa64ee5",

"processingSchedule": {

"id": "5850fab1-a3e7-4d69-b778-e1030e539254",

"code": "schedulecode",

"name": "schedulename"

},

"name": "periodname",

"description": "abc",

"startDate": "2016-09-08",

"endDate": "2016-09-18"


},

"status": "INITIATED"

},

"createdBy": {

"id": "f9399f39-ddd8-4897-97f8-559c0e5f5802",

"username": "abc",

"firstName": "first",

"lastName": "last",

"email": "abc@wp.pl",

"timezone": "zone",

"verified": true,

"active": true,

"restrictLogin": true

},

"program": {

"id": "96e4acf3-f256-44ff-ba25-e0178d199aa3",

"code": "programcode",

"name": "programname",

"description": "abc",

"periodsSkippable": true

},

"requestingFacility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"receivingFacility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"supplyingFacility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"orderCode": "code123",

"status": "SHIPPED",

"quotedCost": "123"


},

"totalShippedPacks": 2,

"totalReceivedPacks": 2,

"totalReturnedPacks": 2,

"deliveredBy": "testuser",

"receivedBy": "testureceiver",

"receivedData": "2016-09-26"

}

Status 201 Created


6

 

Create a ProofOfDeliveryLines.

In URL:

URL: http://localhost:8080/api/proofOfDeliveryLines/?access_token=7d5fcd3c-f37f-4da9-a726-88e8b59d40ea

Method: Post

Body:

{

"orderLine": {

"id": "bf528042-5a56-405e-b5ba-b4dfdba3091b",

"order": {

"id": "d2ffff07-258f-4ac5-9906-6059be4fc483",

"requisition": {

"id": "26744791-dd00-4631-99a5-09d99a782bf2",

"requisitionLines": [

],

"facility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"program": {

"id": "96e4acf3-f256-44ff-ba25-e0178d199aa3",

"code": "programcode",

"name": "programname",

"description": "abc",

"periodsSkippable": true

},

"processingPeriod": {

"id": "c43682f4-b1f4-4d34-925a-27104fa64ee5",

"processingSchedule": {

"id": "5850fab1-a3e7-4d69-b778-e1030e539254",

"code": "schedulecode",

"name": "schedulename"

},

"name": "periodname",

"description": "abc",

"startDate": "2016-09-08",

"endDate": "2016-09-18"

},

"status": "INITIATED"

},

"createdBy": {

"id": "f9399f39-ddd8-4897-97f8-559c0e5f5802",

"username": "abc",

"firstName": "first",

"lastName": "last",

"email": "abc@wp.pl",

"timezone": "zone",

"verified": true,

"active": true,

"restrictLogin": true

},

"program": {

"id": "96e4acf3-f256-44ff-ba25-e0178d199aa3",

"code": "programcode",

"name": "programname",

"description": "abc",

"periodsSkippable": true

},

"requestingFacility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"receivingFacility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"supplyingFacility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"orderCode": "code123",

"status": "SHIPPED",

"quotedCost": "123"

},

"product": {

"id": "1752b457-0a4b-4de0-bf94-5a6a8002427e",

"code": "productCode",

"primaryName": "productName",

"dispensingUnit": "1",

"dosesPerDispensingUnit": 1,

"packSize": 1,

"packRoundingThreshold": 1,

"roundToZero": true,

"active": true,

"fullSupply": true,

"tracer": true,

"productCategory": {

"id": "3c840e6c-a2e6-482f-b794-90379fcbfe00",

"code": "categorycode",

"name": "categoryname",

"displayOrder": 32

}

},

"orderedQuantity": "12",

"filledQuantity": "12"

},

"proofOfDelivery": {

"id": "f60d68b2-bf37-4c1d-a7ea-a717a3aab81c",

"order": {

"order": {

"id": "d2ffff07-258f-4ac5-9906-6059be4fc483",

"requisition": {

"id": "26744791-dd00-4631-99a5-09d99a782bf2",

"requisitionLines": [

],

"facility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"program": {

"id": "96e4acf3-f256-44ff-ba25-e0178d199aa3",

"code": "programcode",

"name": "programname",

"description": "abc",

"periodsSkippable": true

},

"processingPeriod": {

"id": "c43682f4-b1f4-4d34-925a-27104fa64ee5",

"processingSchedule": {

"id": "5850fab1-a3e7-4d69-b778-e1030e539254",

"code": "schedulecode",

"name": "schedulename"

},

"name": "periodname",

"description": "abc",

"startDate": "2016-09-08",

"endDate": "2016-09-18"

},

"status": "INITIATED"

},

"createdBy": {

"id": "f9399f39-ddd8-4897-97f8-559c0e5f5802",

"username": "abc",

"firstName": "first",

"lastName": "last",

"email": "abc@wp.pl",

"timezone": "zone",

"verified": true,

"active": true,

"restrictLogin": true

},

"program": {

"id": "96e4acf3-f256-44ff-ba25-e0178d199aa3",

"code": "programcode",

"name": "programname",

"description": "abc",

"periodsSkippable": true

},

"requestingFacility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"receivingFacility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"supplyingFacility": {

"id": "4384c969-8f7a-4184-91d9-9439a15ea096",

"code": "facilitycode",

"name": "facilityname",

"geographicZone": {

"id": "d0e3d1fb-3310-409e-8a0b-41c9aa432072",

"code": "geocode",

"name": "geoname",

"level": {

"id": "fbc05bd7-3bfd-47f3-a449-396a7192e3f9",

"code": "levelcode",

"name": "levelname",

"levelNumber": "32"

}

},

"type": {

"id": "c2029211-6823-48c9-8247-7fde5b91fae0",

"code": "typecode",

"name": "typename"

},

"active": true,

"enabled": true

},

"orderCode": "code123",

"status": "SHIPPED",

"quotedCost": "123"

},

"totalShippedPacks": 2,

"totalReceivedPacks": 2,

"totalReturnedPacks": 2,

"deliveredBy": "testuser",

"receivedBy": "testureceiver",

"receivedData": "2016-09-26"

}

},

"packToShip": "12",

"quantityShipped": "12",

"quantityReceived": "12",

"quantityReturned": "12",

"notes": "somenotes"

}



Status 201 Created


7

Check if the ProofOfDelivery and its ProofOfDeliveryLines exist.

Method: GET

URL: http://localhost:8080/api/proofOfDeliveryLines?access_token=7d5fcd3c-f37f-4da9-a726-88e8b59d40ea

 

Method: GET

URL: http://localhost:8080/api/proofOfDeliveries?access_token=7d5fcd3c-f37f-4da9-a726-88e8b59d40ea

Status 200 OK



8

Remove the ProofOfDelivery. Check if the ProofOfDeliveryLines were also removed.    

In URL:

http://localhost:8080/api/proofOfDeliveries/f60d68b2-bf37-4c1d-a7ea-a717a3aab81c/?access_token=7d5fcd3c-f37f-4da9-a726-88e8b59d40ea

Method: DELETE

In URL:

http://localhost:8080/api/proofOfDeliveries?access_token=7d5fcd3c-f37f-4da9-a726-88e8b59d40ea

Method: GET

                  

For Delete: Status 204 No Content,

ProofOfDelivery and its ProofOfDeliveryLines are deleted.

Status 200 OK,

Empty list of ProofOfDelivery and ProofOfDeliveryLines




9

Create everything what is needed for a Requisition except RequisitionLines.

In URL : http://localhost:8080/api/requisitions/initiate?access_token=48e42cf1-2861-4ea5-baef-da30e5782e71

Method: Post

Body:

  {

    "id":"2c10b1fc-022c-4712-921d-954b36dfcebc",

    "createdDate": "2016-03-30T15:43:16",

    "facility": { "id": "9db9b475-7475-4366-9b5a-e8ec4776d3e4" },

    "program": { "id": "55915c3e-98a6-4ad9-9100-5403ad173c00" },

    "processingPeriod": { "id": "20b16db5-bd11-4cd2-bc3b-a8c9bf9b840a" },

    "status": "INITIATED",

    "emergency": "false",

    "requisitionLines":[]

}


Status 201 created


10

Create a Requisition together with RequisitionLines.
In URL: http://localhost:8080/api/requisitionLines/?access_token=48e42cf1-2861-4ea5-baef-da30e5782e71

Method: Post

Body:

  {

    "id": "00000000-0000-0000-0000-000000000001",

    "product":{"id": "1752b457-0a4b-4de0-bf94-5a6a8002427e"},

    "requisition":{"id":"2c10b1fc-022c-4712-921d-954b36dfcebc"},

    "stockInHand": 10,

    "beginningBalance": 5,

    "totalReceivedQuantity": 5,

    "requestedQuantity": 15,

    "totalConsumedQuantity": 4

}



Status 201 Created



11

Check if the Requisition and its RequisitionLines exist.

In Url:

 http://localhost:8080/api/requisitions/search?access_token=48e42cf1-2861-4ea5-baef-da30e5782e71

Method: Get



Status 200 OK
12

 Remove the Requisition. Check if the RequisitionLines were also removed.
Method: Delete

In URL:

 http://localhost:8080/api/requisitions/2c10b1fc-022c-4712-921d-954b36dfcebc?access_token=48e42cf1-2861-4ea5-baef-da30e5782e71

Check:

URL:  http://localhost:8080/api/requisitions/search?access_token=48e42cf1-2861-4ea5-baef-da30e5782e71

Method: Get.

URL:  http://localhost:8080/api/requisitionLines/?access_token=48e42cf1-2861-4ea5-baef-da30e5782e71

Method: Get


For Delete: Status 204 No Content,

Order and its OrderLines are deleted.

Status 200 OK,

Empty list of Requistion and RequisitionLines


OpenLMIS: the global initiative for powerful LMIS software