Implemented Product
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
package de.rwu.easydrop.data.model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A Product.
|
|
||||||
*
|
|
||||||
* TODO implement
|
|
||||||
*/
|
|
||||||
public class Product {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
/**
|
|
||||||
* Business objects.
|
|
||||||
*
|
|
||||||
* TODO implement
|
|
||||||
*/
|
|
||||||
package de.rwu.easydrop.data.model;
|
|
||||||
53
src/main/java/de/rwu/easydrop/model/Product.java
Normal file
53
src/main/java/de/rwu/easydrop/model/Product.java
Normal file
@@ -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") + ")]";
|
||||||
|
}
|
||||||
|
}
|
||||||
6
src/main/java/de/rwu/easydrop/model/package-info.java
Normal file
6
src/main/java/de/rwu/easydrop/model/package-info.java
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* Business objects.
|
||||||
|
*
|
||||||
|
* @since 0.2.0
|
||||||
|
*/
|
||||||
|
package de.rwu.easydrop.model;
|
||||||
Reference in New Issue
Block a user