2022-Spring-NYU-DevOps-Shopcarts / shopcarts

Shopcarts squad.
Apache License 2.0
2 stars 2 forks source link

Need to be able to List Shopcarts #4

Closed TimothyXu closed 2 years ago

TimothyXu commented 2 years ago

As a System Administrator I need to be able to use a REST API to list all shopcarts that exist at any given moment So that I can have access to every shopcart.

Details and Assumptions

TimothyXu commented 2 years ago

If I had understood REST API in the last lecture, the correct API call for this should be GET on [our-service]/shopcarts . Do we agree?

TimothyXu commented 2 years ago

For bookkeeping purposes: at Backlog Refinement meeting on 22 Feb we agreed it should indeed be GET

TimothyXu commented 2 years ago

The current implementation for this story lists all 'shopcarts' as defined in our database schema, which includes all items. Is this the functionality we want? Or do we want our list_shopcarts method to return a list of all shopping carts with unique user_ids, as in the normal English meaning of shopcarts?

kdokm commented 2 years ago

Oh, it is because I assume .all() returns all shopcarts not including items. Sorry that I didn’t check it. So, I think maybe we should change .all() in model.py to fix it?

TimothyXu commented 2 years ago

I agree with this. But before we go ahead and make the change, is there any situation where we may want the other functionalities in model.py? (Would we ever need a .all_items or maybe a .all?) Regardless since we're doing DevOps and doing Minimum Viable Product we should just add what we need right now, which I agree is to list all shopcarts not including items.

kdokm commented 2 years ago

I think getting all items only makes sense for a given shopcart, which is already implemented in find_shopcart.

TimothyXu commented 2 years ago

I agree with this.