Implemented Product

This commit is contained in:
Marvin Scham
2023-06-06 02:08:33 +02:00
parent 05487eb285
commit d1bd6f6d9b
4 changed files with 59 additions and 16 deletions

View File

@@ -1,10 +0,0 @@
package de.rwu.easydrop.data.model;
/**
* A Product.
*
* TODO implement
*/
public class Product {
}

View File

@@ -1,6 +0,0 @@
/**
* Business objects.
*
* TODO implement
*/
package de.rwu.easydrop.data.model;

View 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") + ")]";
}
}

View File

@@ -0,0 +1,6 @@
/**
* Business objects.
*
* @since 0.2.0
*/
package de.rwu.easydrop.model;