niryariv / opentaba-server

BSD 3-Clause "New" or "Revised" License
4 stars 13 forks source link

draft for new gushim.json API call #65

Closed niryariv closed 10 years ago

niryariv commented 10 years ago

current response:

[
  {
    "gush_id": "28046",
    "last_checked_at": {
      "$date": 1390647702698
    }
  },
..
]

Suggested:

[
  {
    "gush_id": "28046",
    "plan_dates": [1551411, 123123131, 1231231]
    "<status x>": 3,
    "<status y>": 4,
  },
...
]

status_x, status_y is ״תוכנית בהפקדה״ etc (Github Hebrew support is not great). the keys are determined by the plan statuses, not pre-known.

plan_dates should only include plans 5 years or younger.

@shevron what do u think?

shevron commented 10 years ago

What are the plan_dates values? the timestamps of 5 most recent plans? Also, note that aggregating plan counts by status is a bit of a slow request (that's why its not returned by default, only if you add the ?detailed=true parameter) - its not horrible but we may want to separate into two different API calls, one to get the general list of gushim and one to get detailed info.

niryariv commented 10 years ago

What are the plan_dates values? the timestamps of 5 most recent plans?

Timestamps of all plans since 5 years ago (so we can display something like "7 plans since 2008". Open for discussion though.

Also, note that aggregating plan counts by status is a bit of a slow request

That's cool, because we can cache it for 24 hrs.

e may want to separate into two different API calls, one to get the general list of gushim and one to get detailed info.

There isn't really a need for just list of gushim at the moment, but I see your point

alonisser commented 10 years ago

when talking tabas we should limit ourself to the last 5 years. sometimes the most relevant plan is 10 years ago.. , either bring back all or introduce paging that would return "recent"- the last five years, with a "next" paramater in the answer another request for the rest of the plans. - in case there is a "next" the UI would show something like "Load older plans" button beneath the info div and clicking on it would fetch the rest of the plans

shevron commented 10 years ago

I think the goal is to highlight which Gushim had a lot of activity in the recent years, no? Not necessarily related to the most significant plan in a specific gush, but just an overview of a municipality highlighting active areas.

On Mon, Jan 27, 2014 at 3:18 PM, Alonisser notifications@github.com wrote:

when talking tabas we should limit ourself to the last 5 years. sometimes the most relevant plan is 10 years ago.. , either bring back all or introduce paging that would return "recent"- the last five years, with a "next" paramater in the answer another request for the rest of the plans. - in case there is a "next" the UI would show something like "Load older plans" button beneath the info div and clicking on it would fetch the rest of the plans

— Reply to this email directly or view it on GitHubhttps://github.com/niryariv/opentaba-server/issues/65#issuecomment-33366419 .

niryariv commented 10 years ago

this api call is meant to be used in the homepage, to color different gushim based on their current activity, perhaps also show a hover icon with # of plans.

so, the goal here is to show information that's relatively new (sort of "recent activity" UI) - when a user clicks on a gush she'll still see all the plans, as it works now

niryariv commented 10 years ago

basically implemented in recents.json