Open ykopstein opened 6 years ago
Going with the way that if it dose not exist it should be added to a "need to be added table" .
As a shopper in the shuk I can add a product to a store with its price / rating So that people can get up-to-date results
Requirements
Contribute item button on the main page as in #3
Contribute item page and all its requirements as in #3
Added requirements to #3 before requirement 12 (update db)
Query db to check if item dose / dose not exist in Commodities table
Query db to check if stall dose / dose not exist in Stalls table
If exist Send query to db adding the new info to the CommodityStall table with the CommodityID / StallID
if not exist Before we add the new info to the CommodityStall table Add the product to the "Upcoming Commodity" table or the stall to "Upcoming Stalls" table And then add that UpcomingCommodityID / UpcomingStallID to the CommodityStall table .
About the CommodityID in the CommodityStall table probably needs to be nullable , and maybe we can make another column for Upcoming Commodity ID also be nullable and if the item exists the Commodity ID should be added if dose not exist the Upcoming Commodity ID should be added , latter we can check over the table and add to Commodities table as needed .
Classes & Methods Req. 3 CommodityStall Controller Class > Create method ( Post ) . Req. 4 CommodityStall Controller Class > Create method ( Post ) .
Architecture
CommodityStall Controller Class > Create method ( Post ) > instantiate CommodityStall Repository > Call Save method from repo > repo save method : if statment (if commodityID is null / is not null or StallID is null / is not null ) > send query to db .
i think if the commodity does not exist in the commodities table, it should not even go in to the commodity stall table with the "upcoming commodity table commodityID" , as @ShmielB suggested, my suggestion is that we should make a "upcoming commodity stall table" and if the item does not exist in the commodities table, than the info should go in to the table called "upcoming commodity stall table. And latter we can check the table and add the commodity to the commodities table, and in the regular commodity stall table as needed .
After seeing what @hershyd suggested about having a separate table of "upcoming commodity stall" if the commodity dose not match a commodity from the commodities table , maybe we only need to create one table "upcoming commodity stall" for both for Commodities that are not in the db and for Stalls that are not in the db ,
But i think it would be better that we should make two separate tables of Upcoming Commodity Stall one for Commodities that are not in the db and for Stalls that are not in the db , like this we can work on upcoming commodities separate and on upcoming stalls separate .
Starting to work on it ( Req. 3 , 4 from above )
Lots of discussion in #13 about how to implement suggested contributions. Organize it into actual reqs / user stories and assign as needed. You can also backlog as much as you need.