clean up to created Date field in SavingsAccountTransactionDTO
This commit is contained in:
+5
-5
@@ -13,15 +13,15 @@ public class SavingsAccountTransactionDTO {
|
||||
private final LocalDate transactionDate;
|
||||
private final BigDecimal transactionAmount;
|
||||
private final PaymentDetail paymentDetail;
|
||||
private final Date crecreatedDate;
|
||||
private final Date createdDate;
|
||||
|
||||
public SavingsAccountTransactionDTO(final DateTimeFormatter formatter, final LocalDate transactionDate,
|
||||
final BigDecimal transactionAmount, final PaymentDetail paymentDetail,final Date crecreatedDate) {
|
||||
final BigDecimal transactionAmount, final PaymentDetail paymentDetail, final Date createdDate) {
|
||||
this.formatter = formatter;
|
||||
this.transactionDate = transactionDate;
|
||||
this.transactionAmount = transactionAmount;
|
||||
this.paymentDetail = paymentDetail;
|
||||
this.crecreatedDate = crecreatedDate;
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
|
||||
public DateTimeFormatter getFormatter() {
|
||||
@@ -40,7 +40,7 @@ public class SavingsAccountTransactionDTO {
|
||||
return this.paymentDetail;
|
||||
}
|
||||
|
||||
public Date getCrecreatedDate() {
|
||||
return this.crecreatedDate;
|
||||
public Date getCreatedDate() {
|
||||
return this.createdDate;
|
||||
}
|
||||
}
|
||||
|
||||
+15
-25
@@ -262,8 +262,8 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
final boolean allowOverdraft, final BigDecimal overdraftLimit) {
|
||||
|
||||
final SavingsAccountStatusType status = SavingsAccountStatusType.SUBMITTED_AND_PENDING_APPROVAL;
|
||||
return new SavingsAccount(client, group, product, fieldOfficer, accountNo, externalId, status, accountType, submittedOnDate, submittedBy,
|
||||
interestRate, interestCompoundingPeriodType, interestPostingPeriodType, interestCalculationType,
|
||||
return new SavingsAccount(client, group, product, fieldOfficer, accountNo, externalId, status, accountType, submittedOnDate,
|
||||
submittedBy, interestRate, interestCompoundingPeriodType, interestPostingPeriodType, interestCalculationType,
|
||||
interestCalculationDaysInYearType, minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyType,
|
||||
withdrawalFeeApplicableForTransfer, savingsAccountCharges, allowOverdraft, overdraftLimit);
|
||||
}
|
||||
@@ -549,8 +549,6 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
isTransactionsModified = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,7 +610,7 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
final Money amount = Money.of(this.currency, transactionDTO.getTransactionAmount());
|
||||
|
||||
final SavingsAccountTransaction transaction = SavingsAccountTransaction.deposit(this, office(), transactionDTO.getPaymentDetail(),
|
||||
transactionDTO.getTransactionDate(), amount, transactionDTO.getCrecreatedDate());
|
||||
transactionDTO.getTransactionDate(), amount, transactionDTO.getCreatedDate());
|
||||
this.transactions.add(transaction);
|
||||
|
||||
this.summary.updateSummary(this.currency, this.savingsAccountTransactionSummaryWrapper, this.transactions);
|
||||
@@ -684,7 +682,7 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
final Money transactionAmountMoney = Money.of(this.currency, transactionDTO.getTransactionAmount());
|
||||
final SavingsAccountTransaction transaction = SavingsAccountTransaction.withdrawal(this, office(),
|
||||
transactionDTO.getPaymentDetail(), transactionDTO.getTransactionDate(), transactionAmountMoney,
|
||||
transactionDTO.getCrecreatedDate());
|
||||
transactionDTO.getCreatedDate());
|
||||
this.transactions.add(transaction);
|
||||
|
||||
if (applyWithdrawFee) {
|
||||
@@ -737,14 +735,11 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
limit = limit.plus(this.overdraftLimit);
|
||||
}
|
||||
}
|
||||
if(limit.plus(runningBalance).isLessThanZero()){
|
||||
throw new InsufficientAccountBalanceException("transactionAmount", getAccountBalance(), withdrawalFee, transactionAmount);
|
||||
if (limit.plus(runningBalance).isLessThanZero()) { throw new InsufficientAccountBalanceException("transactionAmount",
|
||||
getAccountBalance(), withdrawalFee, transactionAmount); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void validateAccountBalanceDoesNotBecomeNegative(final String transactionAction) {
|
||||
|
||||
@@ -948,8 +943,7 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
this.allowOverdraft = newValue;
|
||||
}
|
||||
|
||||
if (command.isChangeInBigDecimalParameterNamedDefaultingZeroToNull(overdraftLimitParamName,
|
||||
this.overdraftLimit)) {
|
||||
if (command.isChangeInBigDecimalParameterNamedDefaultingZeroToNull(overdraftLimitParamName, this.overdraftLimit)) {
|
||||
final BigDecimal newValue = command.bigDecimalValueOfParameterNamedDefaultToNullIfZero(overdraftLimitParamName);
|
||||
actualChanges.put(overdraftLimitParamName, newValue);
|
||||
actualChanges.put(localeParamName, localeAsInput);
|
||||
@@ -1476,9 +1470,9 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
this.activatedBy = currentUser;
|
||||
this.lockedInUntilDate = calculateDateAccountIsLockedUntil(getActivationLocalDate());
|
||||
|
||||
/*if (annualFeeSettingsSet()) {
|
||||
updateToNextAnnualFeeDueDateFrom(getActivationLocalDate());
|
||||
}
|
||||
/*
|
||||
* if (annualFeeSettingsSet()) {
|
||||
* updateToNextAnnualFeeDueDateFrom(getActivationLocalDate()); }
|
||||
*/
|
||||
if (this.client != null && this.client.isActivatedAfter(activationDate)) {
|
||||
final DateTimeFormatter formatter = DateTimeFormat.forPattern(command.dateFormat()).withLocale(command.extractLocale());
|
||||
@@ -1541,7 +1535,6 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
recalculateDailyBalances(openingAccountBalance);
|
||||
}
|
||||
|
||||
|
||||
// update annual fee due date
|
||||
for (SavingsAccountCharge charge : this.charges()) {
|
||||
charge.updateToNextDueDateFrom(getActivationLocalDate());
|
||||
@@ -1812,16 +1805,14 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
}
|
||||
|
||||
if (savingsAccountCharge.isSavingsActivation() && !(isSubmittedAndPendingApproval() || (isApproved() && isNotActive()))) {
|
||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode(
|
||||
"not.valid.account.status.cannot.add.activation.time.charge");
|
||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("not.valid.account.status.cannot.add.activation.time.charge");
|
||||
throw new PlatformApiDataValidationException(dataValidationErrors);
|
||||
}
|
||||
|
||||
// Only one withdrawal fee is supported per account
|
||||
if (savingsAccountCharge.isWithdrawalFee()) {
|
||||
if (this.isWithDrawalFeeExists()) {
|
||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode(
|
||||
"multiple.withdrawal.fee.per.account.not.supported");
|
||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("multiple.withdrawal.fee.per.account.not.supported");
|
||||
throw new PlatformApiDataValidationException(dataValidationErrors);
|
||||
}
|
||||
}
|
||||
@@ -1829,8 +1820,7 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
// Only one annual fee is supported per account
|
||||
if (savingsAccountCharge.isAnnualFee()) {
|
||||
if (this.isAnnualFeeExists()) {
|
||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode(
|
||||
"multiple.annual.fee.per.account.not.supported");
|
||||
baseDataValidator.reset().failWithCodeNoParameterAddedToErrorCode("multiple.annual.fee.per.account.not.supported");
|
||||
throw new PlatformApiDataValidationException(dataValidationErrors);
|
||||
}
|
||||
|
||||
@@ -2002,7 +1992,8 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
|
||||
.resource(SAVINGS_ACCOUNT_RESOURCE_NAME);
|
||||
|
||||
if(this.overdraftLimit != null && this.product.overdraftLimit() != null && this.overdraftLimit.compareTo(this.product.overdraftLimit()) == 1){
|
||||
if (this.overdraftLimit != null && this.product.overdraftLimit() != null
|
||||
&& this.overdraftLimit.compareTo(this.product.overdraftLimit()) == 1) {
|
||||
baseDataValidator.reset().parameter(SavingsApiConstants.overdraftLimitParamName).value(this.overdraftLimit)
|
||||
.failWithCode("cannot.exceed.product.value");
|
||||
}
|
||||
@@ -2010,5 +2001,4 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user