diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 982f90f..9a6d8c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: push: branches: - master - + - staging jobs: build: name: Build diff --git a/src/main/java/id/ac/ui/cs/advprog/snackscription_subscriptionbox/model/builder/ItemBuilder.java b/src/main/java/id/ac/ui/cs/advprog/snackscription_subscriptionbox/model/builder/ItemBuilder.java deleted file mode 100644 index 9c46b1d..0000000 --- a/src/main/java/id/ac/ui/cs/advprog/snackscription_subscriptionbox/model/builder/ItemBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -package id.ac.ui.cs.advprog.snackscription_subscriptionbox.model.builder; - -import org.springframework.stereotype.Component; -import id.ac.ui.cs.advprog.snackscription_subscriptionbox.model.Item; - -@Component -public class ItemBuilder { - private Item item; - - private ItemBuilder() { - item = new Item(); - } - - public Item setName(String name) { - item.setName(name); - return item; - } - - public Item setQuantity(int quantity) { - item.setQuantity(quantity); - return item; - } - - public Item setId(String id) { - item.setId(id); - return item; - } - -} diff --git a/src/main/java/id/ac/ui/cs/advprog/snackscription_subscriptionbox/model/builder/SubscriptionBoxBuilder.java b/src/main/java/id/ac/ui/cs/advprog/snackscription_subscriptionbox/model/builder/SubscriptionBoxBuilder.java deleted file mode 100644 index 5555acb..0000000 --- a/src/main/java/id/ac/ui/cs/advprog/snackscription_subscriptionbox/model/builder/SubscriptionBoxBuilder.java +++ /dev/null @@ -1,49 +0,0 @@ -package id.ac.ui.cs.advprog.snackscription_subscriptionbox.model.builder; - -import java.util.ArrayList; - -import org.springframework.beans.factory.annotation.Autowired; - -import id.ac.ui.cs.advprog.snackscription_subscriptionbox.model.SubscriptionBox; -import id.ac.ui.cs.advprog.snackscription_subscriptionbox.repository.SubscriptionBoxRepository; - - -public class SubscriptionBoxBuilder { - private SubscriptionBox subscriptionBox; - - @Autowired - private SubscriptionBoxRepository subscriptionBoxRepository; - - public SubscriptionBoxBuilder() { - this.subscriptionBox = new SubscriptionBox(); - } - - public SubscriptionBoxBuilder setName(String name) { - subscriptionBox.setName(name); - return this; - } - - public SubscriptionBoxBuilder setType(String type) { - if (type.equals("MONTHLY") | type.equals("QUARTERLY") | type.equals("SEMI-ANNUALLY")){ - return this; - - } - throw new IllegalArgumentException("Invalid Type."); - } - - public SubscriptionBoxBuilder setPrice(int price) { - subscriptionBox.setPrice(price); - return this; - } - - public SubscriptionBoxBuilder setItems() { - subscriptionBox.setItems(new ArrayList<>()); - return this; - } - - public SubscriptionBoxBuilder setId(String id) { - subscriptionBox.setId(id); - return this; - } - -} \ No newline at end of file