Fixed misnaming with real consequences: reference account should've been
alternative account.
diff --git a/api/src/main/java/io/mifos/portfolio/api/v1/domain/AccountAssignment.java b/api/src/main/java/io/mifos/portfolio/api/v1/domain/AccountAssignment.java
index 31fa303..e9b58e8 100644
--- a/api/src/main/java/io/mifos/portfolio/api/v1/domain/AccountAssignment.java
+++ b/api/src/main/java/io/mifos/portfolio/api/v1/domain/AccountAssignment.java
@@ -40,7 +40,7 @@
@Length(max = 256)
@Nullable
- private String referenceAccountIdentifier;
+ private String alternativeAccountNumber;
public AccountAssignment() {
}
@@ -49,7 +49,7 @@
this.designator = toCopy.designator;
this.accountIdentifier = toCopy.accountIdentifier;
this.ledgerIdentifier = toCopy.ledgerIdentifier;
- this.referenceAccountIdentifier = toCopy.referenceAccountIdentifier;
+ this.alternativeAccountNumber = toCopy.alternativeAccountNumber;
}
public AccountAssignment(String designator, String accountIdentifier) {
@@ -82,12 +82,12 @@
}
@Nullable
- public String getReferenceAccountIdentifier() {
- return referenceAccountIdentifier;
+ public String getAlternativeAccountNumber() {
+ return alternativeAccountNumber;
}
- public void setReferenceAccountIdentifier(@Nullable String referenceAccountIdentifier) {
- this.referenceAccountIdentifier = referenceAccountIdentifier;
+ public void setAlternativeAccountNumber(@Nullable String alternativeAccountNumber) {
+ this.alternativeAccountNumber = alternativeAccountNumber;
}
@Override
@@ -98,12 +98,12 @@
return Objects.equals(designator, that.designator) &&
Objects.equals(accountIdentifier, that.accountIdentifier) &&
Objects.equals(ledgerIdentifier, that.ledgerIdentifier) &&
- Objects.equals(referenceAccountIdentifier, that.referenceAccountIdentifier);
+ Objects.equals(alternativeAccountNumber, that.alternativeAccountNumber);
}
@Override
public int hashCode() {
- return Objects.hash(designator, accountIdentifier, ledgerIdentifier, referenceAccountIdentifier);
+ return Objects.hash(designator, accountIdentifier, ledgerIdentifier, alternativeAccountNumber);
}
@Override
@@ -112,7 +112,7 @@
"designator='" + designator + '\'' +
", accountIdentifier='" + accountIdentifier + '\'' +
", ledgerIdentifier='" + ledgerIdentifier + '\'' +
- ", referenceAccountIdentifier='" + referenceAccountIdentifier + '\'' +
+ ", alternativeAccountNumber='" + alternativeAccountNumber + '\'' +
'}';
}
}
\ No newline at end of file
diff --git a/api/src/test/java/io/mifos/portfolio/api/v1/domain/AccountAssignmentTest.java b/api/src/test/java/io/mifos/portfolio/api/v1/domain/AccountAssignmentTest.java
index 9778e8e..cc7aeeb 100644
--- a/api/src/test/java/io/mifos/portfolio/api/v1/domain/AccountAssignmentTest.java
+++ b/api/src/test/java/io/mifos/portfolio/api/v1/domain/AccountAssignmentTest.java
@@ -55,7 +55,7 @@
.adjustment(x -> { x.setLedgerIdentifier("zzz"); x.setAccountIdentifier(null); })
.valid(true));
ret.add(new ValidationTestCase<AccountAssignment>("alternativeAccountIdentifierSet")
- .adjustment(x -> x.setReferenceAccountIdentifier("asd;lf///kjasdf"))
+ .adjustment(x -> x.setAlternativeAccountNumber("asd;lf///kjasdf"))
.valid(true));
return ret;
}
diff --git a/component-test/src/main/java/io/mifos/portfolio/AccountingFixture.java b/component-test/src/main/java/io/mifos/portfolio/AccountingFixture.java
index f49a28c..3dd3e79 100644
--- a/component-test/src/main/java/io/mifos/portfolio/AccountingFixture.java
+++ b/component-test/src/main/java/io/mifos/portfolio/AccountingFixture.java
@@ -332,7 +332,7 @@
private static class AccountMatcher extends ArgumentMatcher<Account> {
private final String ledgerIdentifer;
private final String accountDesignator;
- private final String referenceAccountIdentifier;
+ private final String alternativeAccountNumber;
private final AccountType type;
private final BigDecimal balance;
private Account matchedArgument;
@@ -340,12 +340,12 @@
private AccountMatcher(
final String ledgerIdentifier,
final String accountDesignator,
- final @Nullable String referenceAccountIdentifier,
+ final @Nullable String alternativeAccountNumber,
final AccountType type,
final BigDecimal balance) {
this.ledgerIdentifer = ledgerIdentifier;
this.accountDesignator = accountDesignator;
- this.referenceAccountIdentifier = referenceAccountIdentifier;
+ this.alternativeAccountNumber = alternativeAccountNumber;
this.type = type;
this.balance = balance;
this.matchedArgument = null; //Set when matches called and returns true.
@@ -362,7 +362,7 @@
final boolean ret = Objects.equals(checkedArgument.getLedger(), ledgerIdentifer) &&
checkedArgument.getIdentifier().contains(accountDesignator) &&
- Objects.equals(checkedArgument.getReferenceAccount(), referenceAccountIdentifier) &&
+ Objects.equals(checkedArgument.getAlternativeAccountNumber(), alternativeAccountNumber) &&
Objects.equals(checkedArgument.getType(), type.name()) &&
checkedArgument.getBalance().compareTo(balance.doubleValue()) == 0;
@@ -386,7 +386,7 @@
return "AccountMatcher{" +
"ledgerIdentifer='" + ledgerIdentifer + '\'' +
", accountDesignator='" + accountDesignator + '\'' +
- ", referenceAccountIdentifier='" + referenceAccountIdentifier + '\'' +
+ ", alternativeAccountNumber='" + alternativeAccountNumber + '\'' +
", type=" + type +
", balance=" + balance +
'}';
@@ -636,10 +636,10 @@
final LedgerManager ledgerManager,
final String ledgerIdentifier,
final String accountDesignator,
- final @Nullable String referenceAccountIdentifier,
+ final @Nullable String alternativeAccountNumber,
final AccountType type,
final BigDecimal balance) {
- final AccountMatcher specifiesCorrectAccount = new AccountMatcher(ledgerIdentifier, accountDesignator, referenceAccountIdentifier, type, balance);
+ final AccountMatcher specifiesCorrectAccount = new AccountMatcher(ledgerIdentifier, accountDesignator, alternativeAccountNumber, type, balance);
Mockito.verify(ledgerManager).createAccount(AdditionalMatchers.and(argThat(isValid()), argThat(specifiesCorrectAccount)));
return specifiesCorrectAccount.getMatchedArgument().getIdentifier();
}
diff --git a/component-test/src/main/java/io/mifos/portfolio/TestAccountingInteractionInLoanWorkflow.java b/component-test/src/main/java/io/mifos/portfolio/TestAccountingInteractionInLoanWorkflow.java
index 51bd2ba..d551dae 100644
--- a/component-test/src/main/java/io/mifos/portfolio/TestAccountingInteractionInLoanWorkflow.java
+++ b/component-test/src/main/java/io/mifos/portfolio/TestAccountingInteractionInLoanWorkflow.java
@@ -528,15 +528,15 @@
final AccountAssignment customerLoanPrincipalAccountAssignment = new AccountAssignment();
customerLoanPrincipalAccountAssignment.setDesignator(AccountDesignators.CUSTOMER_LOAN_PRINCIPAL);
- customerLoanPrincipalAccountAssignment.setReferenceAccountIdentifier("external-system-sourced-customer-loan-principal-account-identifier");
+ customerLoanPrincipalAccountAssignment.setAlternativeAccountNumber("external-system-sourced-customer-loan-principal-account-identifier");
customerLoanPrincipalAccountAssignment.setLedgerIdentifier(AccountDesignators.CUSTOMER_LOAN_GROUP);
final AccountAssignment customerLoanInterestAccountAssignment = new AccountAssignment();
customerLoanInterestAccountAssignment.setDesignator(AccountDesignators.CUSTOMER_LOAN_INTEREST);
- customerLoanInterestAccountAssignment.setReferenceAccountIdentifier("external-system-sourced-customer-loan-interest-account-identifier");
+ customerLoanInterestAccountAssignment.setAlternativeAccountNumber("external-system-sourced-customer-loan-interest-account-identifier");
customerLoanInterestAccountAssignment.setLedgerIdentifier(AccountDesignators.CUSTOMER_LOAN_GROUP);
final AccountAssignment customerLoanFeeAccountAssignment = new AccountAssignment();
customerLoanFeeAccountAssignment.setDesignator(AccountDesignators.CUSTOMER_LOAN_FEES);
- customerLoanFeeAccountAssignment.setReferenceAccountIdentifier("external-system-sourced-customer-loan-fees-account-identifier");
+ customerLoanFeeAccountAssignment.setAlternativeAccountNumber("external-system-sourced-customer-loan-fees-account-identifier");
customerLoanFeeAccountAssignment.setLedgerIdentifier(AccountDesignators.CUSTOMER_LOAN_GROUP);
final ArrayList<AccountAssignment> importAccountAssignments = new ArrayList<>();
importAccountAssignments.add(customerLoanPrincipalAccountAssignment);
@@ -562,7 +562,7 @@
AccountingFixture.verifyAccountCreationMatchingDesignator(
ledgerManager, customerLoanLedgerIdentifier,
AccountDesignators.CUSTOMER_LOAN_PRINCIPAL,
- customerLoanPrincipalAccountAssignment.getReferenceAccountIdentifier(),
+ customerLoanPrincipalAccountAssignment.getAlternativeAccountNumber(),
AccountType.ASSET,
currentPrincipal);
customerLoanInterestIdentifier =
@@ -570,7 +570,7 @@
ledgerManager,
customerLoanLedgerIdentifier,
AccountDesignators.CUSTOMER_LOAN_INTEREST,
- customerLoanInterestAccountAssignment.getReferenceAccountIdentifier(),
+ customerLoanInterestAccountAssignment.getAlternativeAccountNumber(),
AccountType.ASSET,
BigDecimal.ZERO);
customerLoanFeeIdentifier =
@@ -578,7 +578,7 @@
ledgerManager,
customerLoanLedgerIdentifier,
AccountDesignators.CUSTOMER_LOAN_FEES,
- customerLoanFeeAccountAssignment.getReferenceAccountIdentifier(),
+ customerLoanFeeAccountAssignment.getAlternativeAccountNumber(),
AccountType.ASSET,
BigDecimal.ZERO);
@@ -615,15 +615,15 @@
final AccountAssignment customerLoanPrincipalAccountAssignment = new AccountAssignment();
customerLoanPrincipalAccountAssignment.setDesignator(AccountDesignators.CUSTOMER_LOAN_PRINCIPAL);
customerLoanPrincipalAccountAssignment.setAccountIdentifier(AccountingFixture.IMPORTED_CUSTOMER_LOAN_PRINCIPAL_ACCOUNT);
- customerLoanPrincipalAccountAssignment.setReferenceAccountIdentifier("external-system-sourced-customer-loan-principal-account-identifier");
+ customerLoanPrincipalAccountAssignment.setAlternativeAccountNumber("external-system-sourced-customer-loan-principal-account-identifier");
final AccountAssignment customerLoanInterestAccountAssignment = new AccountAssignment();
customerLoanInterestAccountAssignment.setDesignator(AccountDesignators.CUSTOMER_LOAN_INTEREST);
customerLoanInterestAccountAssignment.setAccountIdentifier(AccountingFixture.IMPORTED_CUSTOMER_LOAN_INTEREST_ACCOUNT);
- customerLoanInterestAccountAssignment.setReferenceAccountIdentifier("external-system-sourced-customer-loan-interest-account-identifier");
+ customerLoanInterestAccountAssignment.setAlternativeAccountNumber("external-system-sourced-customer-loan-interest-account-identifier");
final AccountAssignment customerLoanFeeAccountAssignment = new AccountAssignment();
customerLoanFeeAccountAssignment.setDesignator(AccountDesignators.CUSTOMER_LOAN_FEES);
customerLoanFeeAccountAssignment.setAccountIdentifier(AccountingFixture.IMPORTED_CUSTOMER_LOAN_FEES_ACCOUNT);
- customerLoanFeeAccountAssignment.setReferenceAccountIdentifier("external-system-sourced-customer-loan-fees-account-identifier");
+ customerLoanFeeAccountAssignment.setAlternativeAccountNumber("external-system-sourced-customer-loan-fees-account-identifier");
final ArrayList<AccountAssignment> importAccountAssignments = new ArrayList<>();
importAccountAssignments.add(customerLoanPrincipalAccountAssignment);
importAccountAssignments.add(customerLoanInterestAccountAssignment);
diff --git a/service/src/main/java/io/mifos/individuallending/internal/service/DesignatorToAccountIdentifierMapper.java b/service/src/main/java/io/mifos/individuallending/internal/service/DesignatorToAccountIdentifierMapper.java
index 25b7379..cda8fb8 100644
--- a/service/src/main/java/io/mifos/individuallending/internal/service/DesignatorToAccountIdentifierMapper.java
+++ b/service/src/main/java/io/mifos/individuallending/internal/service/DesignatorToAccountIdentifierMapper.java
@@ -178,8 +178,8 @@
final Set<RequiredAccountAssignment> accountAssignmentsRequired = IndividualLendingPatternFactory.individualLendingPattern().getAccountAssignmentsRequired();
final Map<String, RequiredAccountAssignment> accountAssignmentsRequiredMap = accountAssignmentsRequired.stream().collect(Collectors.toMap(RequiredAccountAssignment::getAccountDesignator, x -> x));
final Map<String, String> accountAssignmentAlternativeAccountIdsMap = oneTimeAccountAssignments.stream()
- .filter(x -> x.getReferenceAccountIdentifier() != null)
- .collect(Collectors.toMap(AccountAssignment::getDesignator, AccountAssignment::getReferenceAccountIdentifier));
+ .filter(x -> x.getAlternativeAccountNumber() != null)
+ .collect(Collectors.toMap(AccountAssignment::getDesignator, AccountAssignment::getAlternativeAccountNumber));
final Map<String, String> existingAccountsAssignmentsMap = oneTimeAccountAssignments.stream()
.filter(x -> x.getAccountIdentifier() != null)
.collect(Collectors.toMap(AccountAssignment::getDesignator, AccountAssignment::getAccountIdentifier));
@@ -195,7 +195,7 @@
return ledgerAccountAssignments
.map(ledgerAccountAssignment -> {
final AccountAssignment ret = new AccountAssignment(ledgerAccountAssignment);
- ret.setReferenceAccountIdentifier(accountAssignmentAlternativeAccountIdsMap.get(ledgerAccountAssignment.getDesignator()));
+ ret.setAlternativeAccountNumber(accountAssignmentAlternativeAccountIdsMap.get(ledgerAccountAssignment.getDesignator()));
final String existingAccountSetting = existingAccountsAssignmentsMap.get(ledgerAccountAssignment.getDesignator());
if (existingAccountSetting != null) ret.setAccountIdentifier(existingAccountSetting);
diff --git a/service/src/main/java/io/mifos/portfolio/service/internal/util/AccountingAdapter.java b/service/src/main/java/io/mifos/portfolio/service/internal/util/AccountingAdapter.java
index 9f395e5..781c1db 100644
--- a/service/src/main/java/io/mifos/portfolio/service/internal/util/AccountingAdapter.java
+++ b/service/src/main/java/io/mifos/portfolio/service/internal/util/AccountingAdapter.java
@@ -299,7 +299,7 @@
final String accountNumber = createCaseAccountNumber(customerIdentifier, ledgerAssignment.getDesignator(), i);
generatedAccount.setIdentifier(accountNumber);
generatedAccount.setName(accountNumber);
- generatedAccount.setReferenceAccount(ledgerAssignment.getReferenceAccountIdentifier());
+ generatedAccount.setAlternativeAccountNumber(ledgerAssignment.getAlternativeAccountNumber());
try {
ledgerManager.createAccount(generatedAccount);
return Optional.of(accountNumber);
diff --git a/service/src/test/java/io/mifos/individuallending/internal/service/DesignatorToAccountIdentifierMapperTest.java b/service/src/test/java/io/mifos/individuallending/internal/service/DesignatorToAccountIdentifierMapperTest.java
index ba232f0..ee85e90 100644
--- a/service/src/test/java/io/mifos/individuallending/internal/service/DesignatorToAccountIdentifierMapperTest.java
+++ b/service/src/test/java/io/mifos/individuallending/internal/service/DesignatorToAccountIdentifierMapperTest.java
@@ -244,10 +244,10 @@
private static AccountAssignment importParameterAccountAssignment(
final String accountDesignator,
- final String referenceAccountIdentifier) {
+ final String alternativeAccountNumber) {
final AccountAssignment ret = new AccountAssignment();
ret.setDesignator(accountDesignator);
- ret.setReferenceAccountIdentifier(referenceAccountIdentifier);
+ ret.setAlternativeAccountNumber(alternativeAccountNumber);
return ret;
}
@@ -272,11 +272,11 @@
private static AccountAssignment assignLedger(
final String accountDesignator,
final String ledgerIdentifier,
- final String referenceAccountIdentifier) {
+ final String alternativeAccountNumber) {
final AccountAssignment ret = new AccountAssignment();
ret.setDesignator(accountDesignator);
ret.setLedgerIdentifier(ledgerIdentifier);
- ret.setReferenceAccountIdentifier(referenceAccountIdentifier);
+ ret.setAlternativeAccountNumber(alternativeAccountNumber);
return ret;
}