added the .toUpperCase for all account Currency

This commit is contained in:
hongwei 2019-10-27 01:25:47 +02:00
parent 331908d853
commit 6243e04d7e
4 changed files with 8 additions and 8 deletions

View File

@ -614,9 +614,9 @@ object LocalMappedConnector extends Connector with MdcLoggable {
val mappedBankAccount = getBankAccount(bankId, accountId).map(_.asInstanceOf[MappedBankAccount]) match {
case Full(f) =>
f.bank(bankId.value).theAccountId(accountId.value).accountCurrency(currency).saveMe()
f.bank(bankId.value).theAccountId(accountId.value).accountCurrency(currency.toUpperCase).saveMe()
case _ =>
MappedBankAccount.create.bank(bankId.value).theAccountId(accountId.value).accountCurrency(currency).saveMe()
MappedBankAccount.create.bank(bankId.value).theAccountId(accountId.value).accountCurrency(currency.toUpperCase).saveMe()
}
Full(mappedBankAccount)
@ -1384,7 +1384,7 @@ object LocalMappedConnector extends Connector with MdcLoggable {
.accountNumber(accountNumber)
.kind(accountType)
.accountLabel(accountLabel)
.accountCurrency(currency)
.accountCurrency(currency.toUpperCase)
.accountBalance(balanceInSmallestCurrencyUnits)
.holder(accountHolderName)
.mBranchId(branchId)

View File

@ -50,7 +50,7 @@ class MappedBankAccount extends BankAccount with LongKeyedMapper[MappedBankAccou
if(i.isEmpty) None else Some(i)
}
override def bankId: BankId = BankId(bank.get)
override def currency: String = accountCurrency.get
override def currency: String = accountCurrency.get.toUpperCase
override def number: String = accountNumber.get
override def balance: BigDecimal = Helper.smallestCurrencyUnitToBigDecimal(accountBalance.get, currency)
override def name: String = accountName.get
@ -67,7 +67,7 @@ class MappedBankAccount extends BankAccount with LongKeyedMapper[MappedBankAccou
def createAccountRule(scheme: String, value: Long) = {
scheme match {
case s: String if s.equalsIgnoreCase("") == false =>
val v = Helper.smallestCurrencyUnitToBigDecimal(value, accountCurrency.get)
val v = Helper.smallestCurrencyUnitToBigDecimal(value, accountCurrency.get.toUpperCase)
List(AccountRule(scheme, v.toString()))
case _ =>
Nil

View File

@ -211,7 +211,7 @@ object LocalMappedConnectorDataImport extends OBPDataImport with CreateAuthUsers
.accountNumber(acc.number)
.kind(acc.`type`)
.accountIban(acc.IBAN)
.accountCurrency(currency)
.accountCurrency(currency.toUpperCase)
.accountBalance(convertToSmallestCurrencyUnits(balance, currency))
}

View File

@ -60,7 +60,7 @@ trait LocalMappedConnectorTestSetup extends TestConnectorSetupWithStandardPermis
.bank(bankId.value)
.accountIban(randomString(20))//Added the Iban for test accounts
.theAccountId(accountId.value)
.accountCurrency(currency)
.accountCurrency(currency.toUpperCase)
.accountBalance(900000000)
.holder(randomString(4))
.accountNumber(randomString(4))
@ -72,7 +72,7 @@ trait LocalMappedConnectorTestSetup extends TestConnectorSetupWithStandardPermis
}
override protected def updateAccountCurrency(bankId: BankId, accountId : AccountId, currency : String) : BankAccount = {
MappedBankAccount.find(By(MappedBankAccount.bank, bankId.value), By(MappedBankAccount.theAccountId, accountId.value)).openOrThrowException(attemptedToOpenAnEmptyBox).accountCurrency(currency).saveMe()
MappedBankAccount.find(By(MappedBankAccount.bank, bankId.value), By(MappedBankAccount.theAccountId, accountId.value)).openOrThrowException(attemptedToOpenAnEmptyBox).accountCurrency(currency.toUpperCase).saveMe()
}
def addEntitlement(bankId: String, userId: String, roleName: String): Box[Entitlement] = {