diff --git a/src/main/java/de/rwu/easydrop/data/model/Product.java b/src/main/java/de/rwu/easydrop/data/model/Product.java deleted file mode 100644 index cfee872..0000000 --- a/src/main/java/de/rwu/easydrop/data/model/Product.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.rwu.easydrop.data.model; - -/** - * A Product. - * - * TODO implement - */ -public class Product { - -} diff --git a/src/main/java/de/rwu/easydrop/data/model/package-info.java b/src/main/java/de/rwu/easydrop/data/model/package-info.java deleted file mode 100644 index f33ce31..0000000 --- a/src/main/java/de/rwu/easydrop/data/model/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Business objects. - * - * TODO implement - */ -package de.rwu.easydrop.data.model; diff --git a/src/main/java/de/rwu/easydrop/model/Product.java b/src/main/java/de/rwu/easydrop/model/Product.java new file mode 100644 index 0000000..1e5b3b2 --- /dev/null +++ b/src/main/java/de/rwu/easydrop/model/Product.java @@ -0,0 +1,53 @@ +package de.rwu.easydrop.model; + +import de.rwu.easydrop.util.FormattingUtil; +import lombok.Data; + +/** + * A Product. + * + * @since 0.2.0 + */ +@Data +public class Product { + /** + * Data source platform, like "Amazon". + */ + private String dataOrigin; + + /** + * Platform internal product identifier. + */ + private String productId; + + /** + * Current product price per piece in Euro. + */ + private double currentPrice; + + /** + * Name of mercant offering the product on the platform. + */ + private String merchant; + + /** + * Additional Cost for delivery in Euro. + */ + private double deliveryPrice; + + /** + * Whether the product can be purchased at this point. + */ + private boolean available; + + @Override + public final String toString() { + return "Product: [" + + productId + " from " + + merchant + " (" + + dataOrigin + ")" + + " at " + + FormattingUtil.formatEuro(currentPrice) + " (available: " + + (available ? "yes" : "no") + ")]"; + } +} diff --git a/src/main/java/de/rwu/easydrop/model/package-info.java b/src/main/java/de/rwu/easydrop/model/package-info.java new file mode 100644 index 0000000..0c255df --- /dev/null +++ b/src/main/java/de/rwu/easydrop/model/package-info.java @@ -0,0 +1,6 @@ +/** + * Business objects. + * + * @since 0.2.0 + */ +package de.rwu.easydrop.model;