LeahK / CowCareMobileApplication

This is a working version of the Katy's Cow Care Mobile Application.
0 stars 1 forks source link

When TODO is toggled in main screen, a list of calves on the TODO list shows up #4

Open buckmaxwell opened 8 years ago

buckmaxwell commented 8 years ago

When TODO is toggled, calves on the TODO list should show up in order of how much time has expired since they entered the TODO list. See screen 2 for the general areal that the calves should show up in.

To retrieve this data a GET request should be sent to the mock api for

GET /calves?filter[waiting]=true&filter[wait_expires]=>1456426326&sort=wait_expires&offset=0&limit=100

Note: 1456426326 is today's date integer encoded. The date is represented in seconds since 1/1/1970

This will retrieve, a list of calves who are on the to do list, sorted by the day they entered the to do list -- those who entered first will appear first. Offset and limit have been set in order to paginate results.

To reduce the number of http requests time, it might be smart to add the include parameter to the collection query like so

GET /calves?filter[waiting]=true &filter[wait_expires]=>1456426326&sort=wait_expires&include=treatment_plan

Notice the edition of include=treatment_plan. This will include any treatment plans the cows are associated with, so that when the cow is clicked, this information can easily be passed on to screen 3 without making another API call.

buckmaxwell commented 8 years ago

@LeahK @liu1372 Mock end point referenced in this description is now set up at

http://private-a59ad-katyscareapi.apiary-mock.com/calves

LeahK commented 8 years ago

TODO now has basic functionality. Is able to display cow ID from arrayList of Cow objects. Lacking Mock Server integration.