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

HCX-41 Search settlement accounts for base subjects, not personal ones #34

Merged
merged 2 commits into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
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
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