Skip to content

Commit

Permalink
HCX-41 Search settlement accounts for base subjects, not personal ones (
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus authored Feb 19, 2020
1 parent 41d7e7f commit 4d12b28
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
-------------------
Expand Down
33 changes: 21 additions & 12 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Account.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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())
}
Expand All @@ -40,7 +49,7 @@ trait Account {
LinkedHashMap params = mergeParams([
accountId : null,
subjectId : null,
accountTypeId : getDefaultAccountTypeId(),
accountTypeId : null,
bankId : null,
currencyId : null,
code : null,
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 4d12b28

Please sign in to comment.