862: Revise relation annotations between models
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 { | Status 201 created | |
2 | Create an Order together with OrderLines. Body { | 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: 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. 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. In URL: 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 | 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