diff --git a/prototype/scripts/addarticles.sql b/prototype/scripts/addarticles.sql index b60497d..e81c174 100644 --- a/prototype/scripts/addarticles.sql +++ b/prototype/scripts/addarticles.sql @@ -1,6 +1,15 @@ -INSERT INTO article_offers ("manufacturer", "article_number", "price_per_unit_net", "title", "vat_percent", "should_be_advertised") -VALUES ("McDonalds", "1", 4242, "McPizza", 7, 1); +/* +* add a supplier first +*/ +INSERT INTO article_offers ("manufacturer", "article_number", "price_per_unit_net", "title", "vat_percent", "should_be_advertised", "cheapest_supplier_id") +VALUES ("McDonalds", "1", 4242, "McPizza", 7, 1, 1); + + + +/* +* There is no need for the add article, you can add one form the UI on the offerd article page +*/ INSERT INTO articles ("related_id", "shop_price_per_unit_net_cent", "warehouse_units_per_slot", "should_reorder", "reorder_max_price", "title", "description", "image_id") VALUES (1, 19.99, 10, 1, 15, "Huge Hamburger", "This huge Hamburger is awesome!", NULL); diff --git a/prototype/scripts/addsupplier.sql b/prototype/scripts/addsupplier.sql new file mode 100644 index 0000000..a56f4ed --- /dev/null +++ b/prototype/scripts/addsupplier.sql @@ -0,0 +1,6 @@ + +INSERT INTO suppliers ("api_url", "name", "uuid") +VALUES ("https://api.com", "Conrad", "fdfdfg4gdfgdf4gfg"); + + + diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java index 7d27059..ca71682 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/intern/suppliers/SupplierOfferController.java @@ -30,8 +30,7 @@ public class SupplierOfferController { for (ArticleOffer article : offersRepository.findAll()) { UImodelOfferedArticle tmp = new UImodelOfferedArticle(); - tmp.addData(article, articleRepository.findArticleIDByRelatedID(article.id)); // TODO display supplier name - // with link + tmp.addData(article, articleRepository.findArticleIDByRelatedID(article.id)); totals.add(tmp); }