-
Notifications
You must be signed in to change notification settings - Fork 1
Purchases: specify package, data range #2
Comments
For select data-range I suggest to use same format as discussed here. I think the 'country-code' also is a good selector for limit the result which also can be use for the Review request also. |
Updated version: https://www.distributorappstore.com/openaep/purchases
?package=com.softspb.flashcards.sv - single parameter
[&datefrom=YYYY-MM-DD] - optional
[&dateto=YYYY-MM-DD] - optional
[&country=US] - optional
[&limit=100] - optional
[&offset=7j8ad9go] - optional Do paginate output there should be <?xml version="1.0" encoding="UTF-8"?>
<purchases version="1" offset="7j8ad9go"> <!-- encoded value of request params, db state and offset -->
<purchase>
... Offset is critical here, nobody wants to lose financial data |
Yes offset is critical as you say, but I can see a problem here. And in this case would it not be good to also include total number of purchase if "limit" or "offset" not was set
|
First time you specify only 'limit' param. Server returns non-empty offset if there is more purchases remained. If there is nothing to request next time - empty offset returns. We have 27 purchases, If you decided to request data by 10 items bulks will you change it's size if get totalCount value? |
Ok, 'offset' will point on the next page to fetch, it works but I think this is not the correct way to work, the main problem here is this only allow us to fetch data in one order, you can't from the current response fetch previous page of data. The only reason I can see to do as your propose is if the data not has a natural indexing, but I think all data will has a natural indexing. (as my proposal to always sort the result in chronological order base on date and time for the Purchases). |
Could you help me to understand use case for fetching data in opposite order? I assumed batches is needed to retrieve big amount of data like purchases for a day or a week. Probably it doesn't work well for pulling data multiple times in a day |
True, this is probably a very uncommon case to read in opposite order. Example:
Give result 0 to 9 and offset "7j8ad9go"
Give result 10 to 19 and offset "8iwadhj0" A ide I have is how to optimize the result and for who, See the new issues #5 |
Hi! |
So, with all that stuff server system for providing feed will be either complicated, or non-consistent. What if we define page size (e.g. 10 items) and prepare these static pages on server? All we have to tell client is url to next page. Yes, it limits the control, but it's much easier to implement and very stable. What do you think? |
Morozstepan, have you read my issues nr #5 I have in this issues a idea to I also see the problem with how to use "offset" but I think this will be no big problem, In my case I probably will use the database index or time-stamp. A other thing we can do here is to limit the result can't be fetch today that will prevent the system to fetch data that is change under the day. |
Current Purchases
Suggest following:
Mandatory:
Optional:
The text was updated successfully, but these errors were encountered: