CCI-MOC / flocx-market

2 stars 9 forks source link

The Offer database API (and other database APIs) should not be within a class #73

Closed tzumainn closed 5 years ago

tzumainn commented 5 years ago

Right now, in https://github.com/CCI-MOC/flocx-market/blob/master/flocx_market/db/sqlalchemy/offer_api.py, we define a OfferApi class that extends OfferModel and provides operations on the OfferModel. However, the OfferApi class may not be what we want; after all, what exactly is an 'OfferApi' object?

What we want a place to put any and all database operations against the OfferModel - not only CRUD on a single OfferModel, but queries that return multiple OfferModels, etc. To that end, it may make more sense to remove the OfferApi class and just have individual functions that perform the database operations we want.