diff --git a/CHANGELOG.md b/CHANGELOG.md index 79c069ca..00612aaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ v1.4.2 [unreleased] - [#28](https://github.com/latera/camunda-ext/pull/28) Fix return types of HID class methods - [#30](https://github.com/latera/camunda-ext/pull/30) Fix wrong Self-Care app id passing into method calls - [#26](https://github.com/latera/camunda-ext/pull/26) Fix passing appCode into hid.Hydra#mainInit method +- [#34](https://github.com/latera/camunda-ext/pull/34) Search settlement accounts for base subjects, not personal ones v1.4.1 [2020-02-14] ------------------- diff --git a/src/org/camunda/latera/bss/connectors/hid/hydra/Account.groovy b/src/org/camunda/latera/bss/connectors/hid/hydra/Account.groovy index d0e4c08a..bb246372 100644 --- a/src/org/camunda/latera/bss/connectors/hid/hydra/Account.groovy +++ b/src/org/camunda/latera/bss/connectors/hid/hydra/Account.groovy @@ -5,6 +5,7 @@ import static org.camunda.latera.bss.utils.DateTimeUtil.local import static org.camunda.latera.bss.utils.DateTimeUtil.dayEnd import static org.camunda.latera.bss.utils.Oracle.encodeDateStr import static org.camunda.latera.bss.utils.Constants.ACC_TYPE_Personal +import static org.camunda.latera.bss.utils.Constants.ACC_TYPE_Settlement import static org.camunda.latera.bss.utils.Constants.OVERDRAFT_Manual import java.time.temporal.Temporal @@ -20,14 +21,22 @@ trait Account { return ACCOUNTS_MV } - String getDefaultAccountType() { - return getRefCode(getDefaultAccountTypeId()) + String getCustomerAccountType() { + return getRefCode(getCustomerAccountTypeId()) } - Number getDefaultAccountTypeId() { + Number getCustomerAccountTypeId() { return ACC_TYPE_Personal } + String getBaseSubjectAccountType() { + return getRefCode(getBaseSubjectAccountTypeId()) + } + + Number getBaseSubjectAccountTypeId() { + return ACC_TYPE_Settlement + } + String getDefaultOverdraftReason() { return getRefCode(getDefaultOverdraftReasonId()) } @@ -40,7 +49,7 @@ trait Account { LinkedHashMap params = mergeParams([ accountId : null, subjectId : null, - accountTypeId : getDefaultAccountTypeId(), + accountTypeId : null, bankId : null, currencyId : null, code : null, @@ -102,56 +111,56 @@ trait Account { List getSubjectAccounts( def subjectId, - def accountTypeId = getDefaultAccountTypeId() + def accountTypeId = null ) { return getAccountsBy(subjectId: subjectId, accountTypeId: accountTypeId) } List getCompanyAccounts( def companyId, - def accountTypeId = getDefaultAccountTypeId() + def accountTypeId = getBaseSubjectAccountTypeId() ) { return getSubjectAccounts(companyId, accountTypeId) } List getPersonAccounts( def personId, - def accountTypeId = getDefaultAccountTypeId() + def accountTypeId = getBaseSubjectAccountTypeId() ) { return getSubjectAccounts(personId, accountTypeId) } List getCustomerAccounts( def customerId, - def accountTypeId = getDefaultAccountTypeId() + def accountTypeId = getCustomerAccountTypeId() ) { return getSubjectAccounts(customerId, accountTypeId) } Map getSubjectAccount( def subjectId, - def accountTypeId = getDefaultAccountTypeId() + def accountTypeId = null ) { return getAccountBy(subjectId: subjectId, accountTypeId: accountTypeId) } Map getCompanyAccount( def companyId, - def accountTypeId = getDefaultAccountTypeId() + def accountTypeId = getBaseSubjectAccountTypeId() ) { return getSubjectAccount(companyId, accountTypeId) } Map getPersonAccount( def personId, - def accountTypeId = getDefaultAccountTypeId() + def accountTypeId = getBaseSubjectAccountTypeId() ) { return getSubjectAccount(personId, accountTypeId) } Map getCustomerAccount( def customerId, - def accountTypeId = getDefaultAccountTypeId() + def accountTypeId = getCustomerAccountTypeId() ) { return getSubjectAccount(customerId, accountTypeId) }