clintonhealthaccess / chailmis-android

Android Tablet Application for Logistics Management in the DHIS2 Platform
Other
7 stars 6 forks source link

Server exposes Service to accept SOH updates from the client #252

Open ihassin opened 8 years ago

ihassin commented 8 years ago

Server exposes REST service to accept SOH updates from the client at arbitrary times.

The HTTP/REST service responds with: 201 created 401 unauthorized 500 unavailable

ihassin commented 8 years ago

Due to return code encapsulation, the client only has success/fail codes without details.

ihassin commented 8 years ago

@garymabin can you please paste the following here:

Example packet sent from client to server (i.e. JSON) Example packet returned from server to client (i.e. JSON, one for success, one for failure)

garymabin commented 8 years ago

QA URL: http://lmisqa.dhis2nigeria.org.ng/api/dataValueSets Prod URL: http://lmisprod.dhis2nigeria.org.ng/api/dataValueSets

And the Client will treat 404 as "Url Not Found", 500 as "Internal Server Error", and any other status code rather than 200 as "Invalid Username or Password."

Example packet sent from client to server { "dataSet": "1ce7aa8c65e", "dataValues": [ { "attributeOptionCombo": "rI1c7yQrL2P", "dataElement": "f5edb97ceca", "orgUnit": "tVmtcBn5bnz", "period": "20131229", "storedBy": "admin", "value": "469" }, { "attributeOptionCombo": "rI1c7yQrL2P", "dataElement": "1aa8dcf5a77", "orgUnit": "tVmtcBn5bnz", "period": "20131229", "storedBy": "admin", "value": "360" }] }

Example packet returned from server to client success: {"status":"SUCCESS","description":"Import process completed successfully","dataValueCount":{"imported":0,"updated":4,"ignored":0,"deleted":0},"importCount":{"imported":0,"updated":0,"ignored":0,"deleted":0},"dataSetComplete":"false"} failure: {"status":"FAILURE","description":"Import process failed","dataValueCount":{"imported":0,"updated":0,"ignored":4,"deleted":0},"importCount":{"imported":0,"updated":0,"ignored":0,"deleted":0},"dataSetComplete":"false"}

ihassin commented 8 years ago

We'll be writing some contract tests against the API to be able to move it to "Done"