Skip to content

Instantly share code, notes, and snippets.

@hongwei1
Created March 12, 2017 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hongwei1/6d72900f6490e49f7fadabccca992a46 to your computer and use it in GitHub Desktop.
Save hongwei1/6d72900f6490e49f7fadabccca992a46 to your computer and use it in GitHub Desktop.
do not know what is it doing ??
def updateUserAccountViews( user: ResourceUser ) = {
val accounts = getBanks.flatMap { bank => {
val bankId = bank.bankId.value
logger.debug(s"ObpJvm updateUserAccountViews for user.email ${user.email} user.name ${user.name} at bank ${bankId}")
val parameters = new JHashMap
parameters.put("userId", user.name)
parameters.put("bankId", bankId)
val response = jvmNorth.get("getAccounts", Transport.Target.accounts, parameters)
// todo response.error().isPresent
response.data().map(d => new AccountReader(d)).map(a => ObpJvmInboundAccount(
a.accountId,
a.bankId,
a.label,
a.number,
a.`type`,
ObpJvmInboundBalance(a.balanceCurrency, a.balanceAmount),
a.iban,
user.name :: Nil,
generate_public_view = true,
generate_accountants_view = true,
generate_auditors_view = true
)).toList
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment