Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LC-255 - Discount from fixed fee #859

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading