Skip to content

Commit

Permalink
LC-255 - Discount from fixed fee (#859)
Browse files Browse the repository at this point in the history
Co-authored-by: Maros Silady <[email protected]>
  • Loading branch information
SMaros and Maros Silady authored Jan 10, 2024
1 parent 0d4dd4a commit 91c2f44
Showing 1 changed file with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
public class DiscountSpec {
private BigDecimal buyDiscount;
private BigDecimal sellDiscount;
private BigDecimal buyFixedFeeDiscount;
private BigDecimal sellFixedFeeDiscount;
private Date validityFrom;
private Date validityTill;
private Long maximumUsages;
Expand All @@ -19,6 +21,60 @@ public class DiscountSpec {
private String notes;

/**
* Creates Discount Specification.
*
* @param buyDiscount
* @param sellDiscount
* @param buyFixedFeeDiscount The percentage discount applied to the fixed fee on purchase transactions
* A value of 10 would represent a 10% discount on the fixed fee for buying.
* @param sellFixedFeeDiscount The percentage discount applied to the fixed fee on sale transactions
* A value of 10 would represent a 10% discount on the fixed fee for selling.
* @param validityFrom
* @param validityTill
* @param maximumUsages
* @param maximumUsagesPerIdentity
* @param minimumTransactionAmount
* @param totalLimit
* @param fiatCurrency in which currency are limit amounts
* @param firstTransactionOnly
* @param code (Optional) Defined code to be used (upper-cased) or null for code to be generated.
* @param linkedIdentityPublicId (Optional) Public ID of an existing identity to be linked to the Discount.
* @param notes (Optional) Notes worth noting.
*/
public DiscountSpec(BigDecimal buyDiscount,
BigDecimal sellDiscount,
BigDecimal buyFixedFeeDiscount,
BigDecimal sellFixedFeeDiscount,
Date validityFrom,
Date validityTill,
Long maximumUsages,
Long maximumUsagesPerIdentity,
BigDecimal minimumTransactionAmount,
BigDecimal totalLimit,
String fiatCurrency,
boolean firstTransactionOnly,
String code,
String linkedIdentityPublicId,
String notes) {
this.buyDiscount = buyDiscount;
this.sellDiscount = sellDiscount;
this.buyFixedFeeDiscount = buyFixedFeeDiscount;
this.sellFixedFeeDiscount = sellFixedFeeDiscount;
this.validityFrom = validityFrom;
this.validityTill = validityTill;
this.maximumUsages = maximumUsages;
this.maximumUsagesPerIdentity = maximumUsagesPerIdentity;
this.minimumTransactionAmount = minimumTransactionAmount;
this.totalLimit = totalLimit;
this.fiatCurrency = fiatCurrency;
this.firstTransactionOnly = firstTransactionOnly;
this.code = code;
this.linkedIdentityPublicId = linkedIdentityPublicId;
this.notes = notes;
}

/**
* @deprecated Use first constructor instead.
* Creates Discount Specification.
*
* @param buyDiscount
Expand All @@ -34,7 +90,9 @@ public class DiscountSpec {
* @param code (Optional) Defined code to be used (upper-cased) or null for code to be generated.
* @param linkedIdentityPublicId (Optional) Public ID of an existing identity to be linked to the Discount.
* @param notes (Optional) Notes worth noting.
*
*/
@Deprecated
public DiscountSpec(BigDecimal buyDiscount, BigDecimal sellDiscount, Date validityFrom, Date validityTill, Long maximumUsages, Long maximumUsagesPerIdentity, BigDecimal minimumTransactionAmount, BigDecimal totalLimit, String fiatCurrency, boolean firstTransactionOnly, String code, String linkedIdentityPublicId, String notes) {
this.buyDiscount = buyDiscount;
this.sellDiscount = sellDiscount;
Expand Down Expand Up @@ -67,6 +125,22 @@ public void setSellDiscount(BigDecimal sellDiscount) {
this.sellDiscount = sellDiscount;
}

public BigDecimal getBuyFixedFeeDiscount() {
return buyFixedFeeDiscount;
}

public void setBuyFixedFeeDiscount(BigDecimal buyFixedFeeDiscount) {
this.buyFixedFeeDiscount = buyFixedFeeDiscount;
}

public BigDecimal getSellFixedFeeDiscount() {
return sellFixedFeeDiscount;
}

public void setSellFixedFeeDiscount(BigDecimal sellFixedFeeDiscount) {
this.sellFixedFeeDiscount = sellFixedFeeDiscount;
}

public Date getValidityFrom() {
return validityFrom;
}
Expand Down

0 comments on commit 91c2f44

Please sign in to comment.