AgileVentures / asyncvoter-api

For Voting on Stories and Tickets remotely and asynchronously e.g. planning poker
5 stars 7 forks source link

List Ongoing Votes Feature #45

Closed joaopapereira closed 8 years ago

joaopapereira commented 8 years ago

fixes #9

tansaku commented 8 years ago

great addition @joaopapereira !

interesting, so you've gone with having a size of zero represent an active vote.

I had been thinking that we'd only support a single active vote in the first instance, but I guess this works fine, given that posting on votes will be by ID so there shouldn't be any confusion about which story a vote applies to.

So this is kind of more we need for an absolute MVP ...

Maybe I'm misinterpreting this, but have you set it up so that GET /stories only returns stories with size 0? That seems a little unRESTful to me. I feel like GET /stories should always return ALL stories, and if we want to modify it then that should be done by passing a parameter. What do you think?

Also some merge conflicts here ...

joaopapereira commented 8 years ago

I am ok with that. Should we go with: GET /stories/active

tansaku commented 8 years ago

@joaopapereira I think ultimately GET /stories/active would get a story that was named active - how about GET /stories?size=0 ?

joaopapereira commented 8 years ago

@tansaku I think we should have a simple endpoint to get all the stories that are actively being voted instead of using the get parameters to do that

arreche commented 8 years ago

I like the idea about filtering actives stories.

http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries

By the way assigning 0 to size sounds like a little trick ;)

joaopapereira commented 8 years ago

What about GET /stories?state=active

tansaku commented 8 years ago

There's interesting discussion here suggesting we use a POST:

http://stackoverflow.com/questions/5020704/how-to-design-restful-search-filtering

tansaku commented 8 years ago

Adding a body or params to a GET breaks caching ...

tansaku commented 8 years ago

Although see also http://stackoverflow.com/questions/207477/restful-url-design-for-search

After reading that I'm thinking GET /stories?size=0

arreche commented 8 years ago

The only thing that I don't like so much is that clients have know about this implementation detail:

stories with size of 0 value are those which are ready to to be voted.

joaopapereira commented 8 years ago

I agree that maybe size=0 is something that we are using for now. I would go with my get suggestion of state=active

tansaku commented 8 years ago

let's work with size=0 for now - and then once we're merged we can look at state=active and see about whether we need to add that to the domain model. I think what we want to avoid in the short term is one language for clients and a separate one for the back end - I'm working from Eric Evans concept of domain driven design where we try to keep a single consistent language throughout the system, at least within a given "bounded context"