Wrote OfferWriter and following classes to save offers to persistence

This commit is contained in:
Leonie Eitze
2023-06-15 18:52:06 +02:00
parent 5436118829
commit 5204cc1710
7 changed files with 227 additions and 2 deletions

View File

@@ -0,0 +1,51 @@
package de.rwu.easydrop.api.dto;
import lombok.Data;
import de.rwu.easydrop.model.Product;
import java.util.Date;
/*
* Offer data transfer object
*/
@Data
public class OfferDTO {
/**
* Platform internal offer identifier.
*/
private String offerId;
/*
* The product that our software buys
*/
Product sourceProduct;
/*
* The product that our software sells
*/
Product saleProduct;
/*
* Date of the creation of the offer
* NOTE: Use Timestamp? https://docs.oracle.com/javase/8/docs/api/java/sql/Timestamp.html
*/
Date creationDate;
/*
* Date of last update of the offer on the destination website (API)
*/
Date upDate;
/*
* Date of last check if offer is still valid
*/
Date checkDate;
/**
* Creates OfferDTO instance.
*
* @param newOfferId Internal Offer identifier
*/
public OfferDTO(final String newOfferId) {
this.offerId = newOfferId;
}
}