From d0f8fc8232cf61a09697a19f3f57b96dc76c449b Mon Sep 17 00:00:00 2001 From: shuang Date: Tue, 14 Jul 2020 08:07:22 +0800 Subject: [PATCH 1/3] feature/ignore_Inbound_field_value_for_unit_test: refactor LocalMappedConnector methods return type to the same as Connector. --- .../main/scala/code/api/util/NewStyle.scala | 4 +- .../scala/code/api/v3_0_0/APIMethods300.scala | 5 +- .../code/api/v3_0_0/JSONFactory3.0.0.scala | 7 +- .../scala/code/bankconnectors/Connector.scala | 4 +- .../KafkaMappedConnector_JVMcompatible.scala | 2 +- .../bankconnectors/LocalMappedConnector.scala | 139 +++++++++--------- .../akka/AkkaConnector_vDec2018.scala | 6 +- .../actor/SouthSideActorOfAkkaConnector.scala | 6 +- .../StoredProcedureConnector_vDec2019.scala | 6 +- .../customerattribute/CustomerAttribute.scala | 3 +- .../MappedCustomerAttributeProvider.scala | 5 +- .../RemotedataCustomerAttribute.scala | 5 +- .../commons/dto/JsonsTransfer.scala | 6 +- 13 files changed, 99 insertions(+), 99 deletions(-) diff --git a/obp-api/src/main/scala/code/api/util/NewStyle.scala b/obp-api/src/main/scala/code/api/util/NewStyle.scala index 5317e3d53..154db3013 100644 --- a/obp-api/src/main/scala/code/api/util/NewStyle.scala +++ b/obp-api/src/main/scala/code/api/util/NewStyle.scala @@ -36,7 +36,7 @@ import code.util.{Helper, JsonUtils} import code.views.Views import code.webhook.AccountWebhook import com.github.dwickern.macros.NameOf.nameOf -import com.openbankproject.commons.dto.ProductCollectionItemsTree +import com.openbankproject.commons.dto.{CustomerAndAttribute, ProductCollectionItemsTree} import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA import com.openbankproject.commons.model.enums._ import com.openbankproject.commons.model.{AccountApplication, Bank, Customer, CustomerAddress, Product, ProductCollection, ProductCollectionItem, TaxResidence, UserAuthContext, UserAuthContextUpdate, _} @@ -1022,7 +1022,7 @@ object NewStyle { def getCustomerAttributesForCustomers( customers: List[Customer], - callContext: Option[CallContext]): OBPReturnType[List[(Customer, List[CustomerAttribute])]] = { + callContext: Option[CallContext]): OBPReturnType[List[CustomerAndAttribute]] = { Connector.connector.vend.getCustomerAttributesForCustomers( customers: List[Customer], callContext: Option[CallContext] diff --git a/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala b/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala index 9ba598c46..b38af256b 100644 --- a/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala +++ b/obp-api/src/main/scala/code/api/v3_0_0/APIMethods300.scala @@ -43,6 +43,7 @@ import com.openbankproject.commons.ExecutionContext.Implicits.global import scala.concurrent.Future import code.api.v2_0_0.AccountsHelper._ +import com.openbankproject.commons.dto.CustomerAndAttribute import com.openbankproject.commons.util.ApiVersion import net.liftweb.json.JsonAST.JField @@ -1594,10 +1595,10 @@ trait APIMethods300 { (customers,callContext) <- Connector.connector.vend.getCustomersByUserId(u.userId, callContext) map { connectorEmptyResponse(_, callContext) } - (customersAndAttributesPairs,callContext) <- NewStyle.function.getCustomerAttributesForCustomers(customers, callContext) + (customersAndAttributes: List[CustomerAndAttribute], callContext) <- NewStyle.function.getCustomerAttributesForCustomers(customers, callContext) } yield { // Create the JSON to return. We also return the callContext - (JSONFactory300.createCustomersWithAttributesJson(customersAndAttributesPairs), HttpCode.`200`(callContext)) + (JSONFactory300.createCustomersWithAttributesJson(customersAndAttributes), HttpCode.`200`(callContext)) } } } diff --git a/obp-api/src/main/scala/code/api/v3_0_0/JSONFactory3.0.0.scala b/obp-api/src/main/scala/code/api/v3_0_0/JSONFactory3.0.0.scala index 7b0699ab9..4b0f16e31 100644 --- a/obp-api/src/main/scala/code/api/v3_0_0/JSONFactory3.0.0.scala +++ b/obp-api/src/main/scala/code/api/v3_0_0/JSONFactory3.0.0.scala @@ -48,6 +48,7 @@ import code.metrics.AggregateMetrics import code.model.dataAccess.ResourceUser import code.scope.Scope import code.views.Views +import com.openbankproject.commons.dto.CustomerAndAttribute import com.openbankproject.commons.model.{Customer, _} import net.liftweb.common.{Box, Full} @@ -1239,10 +1240,10 @@ object JSONFactory300{ CustomerJSONsV300(customers.map(createCustomerJson)) } - def createCustomersWithAttributesJson(customersAndAttributesPairs : List[(Customer, List[CustomerAttribute])]) :CustomersWithAttributesJsonV300 = { + def createCustomersWithAttributesJson(customersAndAttributes : List[CustomerAndAttribute]) :CustomersWithAttributesJsonV300 = { CustomersWithAttributesJsonV300( - customersAndAttributesPairs.map( - customerAndAttributesPair => createCustomerWithAttributesJson(customerAndAttributesPair._1,customerAndAttributesPair._2) + customersAndAttributes.map( + customerAndAttributesPair => createCustomerWithAttributesJson(customerAndAttributesPair.customer,customerAndAttributesPair.attributes) ) ) } diff --git a/obp-api/src/main/scala/code/bankconnectors/Connector.scala b/obp-api/src/main/scala/code/bankconnectors/Connector.scala index 096287264..4ed9c0d8b 100644 --- a/obp-api/src/main/scala/code/bankconnectors/Connector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/Connector.scala @@ -61,7 +61,7 @@ import scala.math.{BigDecimal, BigInt} import scala.util.Random import scala.reflect.runtime.universe.{MethodSymbol, typeOf} import _root_.akka.http.scaladsl.model.HttpMethod -import com.openbankproject.commons.dto.{InBoundTrait, ProductCollectionItemsTree} +import com.openbankproject.commons.dto.{CustomerAndAttribute, InBoundTrait, ProductCollectionItemsTree} /* So we can switch between different sources of resources e.g. @@ -2090,7 +2090,7 @@ trait Connector extends MdcLoggable { def getCustomerAttributesForCustomers( customers: List[Customer], - callContext: Option[CallContext]): OBPReturnType[Box[List[(Customer, List[CustomerAttribute])]]] = + callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAndAttribute]]] = Future{(Failure(setUnimplementedError), callContext)} def getTransactionIdsByAttributeNameValues( diff --git a/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector_JVMcompatible.scala b/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector_JVMcompatible.scala index 3c9396d16..c6b3418a5 100644 --- a/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector_JVMcompatible.scala +++ b/obp-api/src/main/scala/code/bankconnectors/KafkaMappedConnector_JVMcompatible.scala @@ -1159,7 +1159,7 @@ object KafkaMappedConnector_JVMcompatible extends Connector with KafkaHelper wit LocalMappedConnector.createOrUpdateAtm(atm) } - override def getAtmLegacy(bankId: BankId, atmId: AtmId): Box[MappedAtm] = { + override def getAtmLegacy(bankId: BankId, atmId: AtmId): Box[AtmT] = { LocalMappedConnector.getAtmLegacy(bankId, atmId) } diff --git a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala index 1bf1f063f..9c424706d 100644 --- a/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/LocalMappedConnector.scala @@ -3,7 +3,7 @@ package code.bankconnectors import java.util.Date import java.util.UUID.randomUUID -import scala.concurrent.duration._ +import _root_.akka.http.scaladsl.model.HttpMethod import code.DynamicData.DynamicDataProvider import code.DynamicEndpoint.{DynamicEndpointProvider, DynamicEndpointT} import code.accountapplication.AccountApplicationX @@ -17,7 +17,7 @@ import code.api.util.ApiRole.canCreateAnyTransactionRequest import code.api.util.ErrorMessages._ import code.api.util._ import code.api.v1_4_0.JSONFactory1_4_0.TransactionRequestAccountJsonV140 -import code.api.v2_1_0.{CounterpartyIdJson, IbanJson, TransactionRequestBodyCounterpartyJSON, TransactionRequestBodyFreeFormJSON, TransactionRequestBodySEPAJSON, TransactionRequestBodySandBoxTanJSON} +import code.api.v2_1_0._ import code.atms.Atms.Atm import code.atms.MappedAtm import code.branches.Branches.Branch @@ -27,13 +27,10 @@ import code.cards.MappedPhysicalCard import code.context.{UserAuthContextProvider, UserAuthContextUpdateProvider} import code.customer._ import code.customeraddress.CustomerAddressX -import code.customerattribute.{CustomerAttributeX, MappedCustomerAttribute} +import code.customerattribute.CustomerAttributeX import code.directdebit.DirectDebits -import com.openbankproject.commons.model.DirectDebitTrait -import code.dynamicEntity.{DynamicEntityProvider, DynamicEntityT} import code.fx.fx.TTL import code.fx.{MappedFXRate, fx} -import com.openbankproject.commons.model.FXRate import code.kycchecks.KycChecks import code.kycdocuments.KycDocuments import code.kycmedias.KycMedias @@ -58,9 +55,8 @@ import code.taxresidence.TaxResidenceX import code.transaction.MappedTransaction import code.transactionChallenge.ExpectedChallengeAnswer import code.transactionattribute.TransactionAttributeX -import code.transactionrequests.TransactionRequests.TransactionRequestTypes.{ACCOUNT, ACCOUNT_OTP, COUNTERPARTY, FREE_FORM, REFUND, SANDBOX_TAN, SEPA, SEPA_CREDIT_TRANSFERS} +import code.transactionrequests.TransactionRequests.TransactionRequestTypes._ import code.transactionrequests.TransactionRequests.{TransactionChallengeTypes, TransactionRequestTypes} -import com.openbankproject.commons.model.enums.TransactionRequestStatus import code.transactionrequests._ import code.users.Users import code.util.Helper @@ -69,10 +65,12 @@ import code.views.Views import com.google.common.cache.CacheBuilder import com.nexmo.client.NexmoClient import com.nexmo.client.sms.messages.TextMessage +import com.openbankproject.commons.ExecutionContext.Implicits.global +import com.openbankproject.commons.dto.{CustomerAndAttribute, ProductCollectionItemsTree} import com.openbankproject.commons.model.enums.DynamicEntityOperation._ import com.openbankproject.commons.model.enums.StrongCustomerAuthentication.SCA -import com.openbankproject.commons.model.enums._ -import com.openbankproject.commons.model.{AccountApplication, AccountAttribute, Product, ProductAttribute, ProductCollectionItem, TaxResidence, _} +import com.openbankproject.commons.model.enums.{TransactionRequestStatus, _} +import com.openbankproject.commons.model.{AccountApplication, AccountAttribute, DirectDebitTrait, FXRate, Product, ProductAttribute, ProductCollectionItem, TaxResidence, _} import com.tesobe.CacheKeyFromArguments import com.tesobe.model.UpdateBankAccount import net.liftweb.common._ @@ -87,14 +85,11 @@ import scalacache.ScalaCache import scalacache.guava.GuavaCache import scala.collection.immutable.{List, Nil} -import com.openbankproject.commons.ExecutionContext.Implicits.global - import scala.concurrent._ +import scala.concurrent.duration._ import scala.language.postfixOps import scala.math.{BigDecimal, BigInt} import scala.util.Random -import _root_.akka.http.scaladsl.model.HttpMethod -import com.openbankproject.commons.dto.ProductCollectionItemsTree object LocalMappedConnector extends Connector with MdcLoggable { @@ -128,7 +123,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { currency: String, userId: String, username: String, - callContext: Option[CallContext]): Future[(Box[AmountOfMoney], Option[CallContext])] = Future { + callContext: Option[CallContext]): OBPReturnType[Box[AmountOfMoney]] = Future { val propertyName = "transactionRequests_challenge_threshold_" + transactionRequestType.toUpperCase val threshold = BigDecimal(APIUtil.getPropsValue(propertyName, "1000")) logger.debug(s"threshold is $threshold") @@ -167,7 +162,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[SCA], - callContext: Option[CallContext]) = Future { + callContext: Option[CallContext]): OBPReturnType[Box[String]] = Future { createChallengeInternal(bankId: BankId, accountId: AccountId, userId: String, @@ -192,7 +187,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { transactionRequestType: TransactionRequestType, transactionRequestId: String, scaMethod: Option[SCA], - callContext: Option[CallContext]) = Future { + callContext: Option[CallContext]): OBPReturnType[Box[List[String]]] = Future { val challenges = for { userId <- userIds } yield { @@ -282,7 +277,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { * 3. Compare the hash of the given answer with the hash from the database. If they match, the answer is correct. Otherwise, the answer is incorrect. */ // TODO Extend database model in order to get users salt and hash it - override def validateChallengeAnswer(challengeId: String, hashOfSuppliedAnswer: String, callContext: Option[CallContext]) = Future { + override def validateChallengeAnswer(challengeId: String, hashOfSuppliedAnswer: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future { val answer = for { nonEmpty <- booleanToBox(hashOfSuppliedAnswer.nonEmpty) ?~ "Need a non-empty answer" answerToNumber <- tryo(BigInt(hashOfSuppliedAnswer)) ?~! "Need a numeric TAN" @@ -299,7 +294,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { username: String, transactionRequestType: String, currency: String, - callContext: Option[CallContext]) = Future { + callContext: Option[CallContext]): OBPReturnType[Box[AmountOfMoney]] = Future { val propertyName = "transactionRequests_charge_level_" + transactionRequestType.toUpperCase val chargeLevel = BigDecimal(APIUtil.getPropsValue(propertyName, "0.0001")) logger.debug(s"transactionRequests_charge_level is $chargeLevel") @@ -315,7 +310,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { } //gets a particular bank handled by this connector - override def getBankLegacy(bankId: BankId, callContext: Option[CallContext]) = saveConnectorMetric { + override def getBankLegacy(bankId: BankId, callContext: Option[CallContext]): Box[(Bank, Option[CallContext])] = saveConnectorMetric { getMappedBank(bankId).map(bank => (bank, callContext)) }("getBank") @@ -329,12 +324,12 @@ object LocalMappedConnector extends Connector with MdcLoggable { .mBankRoutingAddress(APIUtil.ValueOrOBPId(bank.bankRoutingAddress, bank.bankId.value)) ) - override def getBank(bankId: BankId, callContext: Option[CallContext]) = Future { + override def getBank(bankId: BankId, callContext: Option[CallContext]): Future[Box[(Bank, Option[CallContext])]] = Future { getBankLegacy(bankId, callContext) } - override def getBanksLegacy(callContext: Option[CallContext]): Box[(List[MappedBank], Option[CallContext])] = saveConnectorMetric { + override def getBanksLegacy(callContext: Option[CallContext]): Box[(List[Bank], Option[CallContext])] = saveConnectorMetric { Full(MappedBank .findAll() .map( @@ -347,7 +342,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { ) }("getBanks") - override def getBanks(callContext: Option[CallContext]) = Future { + override def getBanks(callContext: Option[CallContext]): Future[Box[(List[Bank], Option[CallContext])]] = Future { getBanksLegacy(callContext) } @@ -446,7 +441,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { getTransactionsCached(bankId: BankId, accountId: AccountId, optionalParams).map(transactions => (transactions, callContext)) } - override def getTransactionsCore(bankId: BankId, accountId: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]) = { + override def getTransactionsCore(bankId: BankId, accountId: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = { // TODO Refactor this. No need for database lookups etc. val limit = queryParams.collect { case OBPLimit(value) => MaxRows[MappedTransaction](value) }.headOption @@ -577,7 +572,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { } } - override def getBankAccountsBalances(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) = + override def getBankAccountsBalances(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[AccountsBalances]] = Future { val accountsBalances = for { bankIdAccountId <- bankIdAccountIds @@ -619,11 +614,11 @@ object LocalMappedConnector extends Connector with MdcLoggable { )), callContext) } - override def checkBankAccountExistsLegacy(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]) = { + override def checkBankAccountExistsLegacy(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): Box[(BankAccount, Option[CallContext])] = { getBankAccountLegacy(bankId: BankId, accountId: AccountId, callContext) } - override def checkBankAccountExists(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]) = + override def checkBankAccountExists(bankId: BankId, accountId: AccountId, callContext: Option[CallContext]): OBPReturnType[Box[BankAccount]] = Future { (getBankAccountLegacy(bankId: BankId, accountId: AccountId, callContext).map(_._1), callContext) } @@ -671,7 +666,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { ) } - override def getBankAccountsHeld(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]) = { + override def getBankAccountsHeld(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]): OBPReturnType[Box[List[AccountHeld]]] = { Future { (getBankAccountsHeldLegacy(bankIdAccountIds: List[BankIdAccountId], callContext: Option[CallContext]), callContext) } @@ -721,27 +716,27 @@ object LocalMappedConnector extends Connector with MdcLoggable { } } - override def getCounterpartyTrait(bankId: BankId, accountId: AccountId, counterpartyId: String, callContext: Option[CallContext]) = { + override def getCounterpartyTrait(bankId: BankId, accountId: AccountId, counterpartyId: String, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { getCounterpartyByCounterpartyId(CounterpartyId(counterpartyId), callContext) } - override def getCounterpartyByCounterpartyIdLegacy(counterpartyId: CounterpartyId, callContext: Option[CallContext]) = { + override def getCounterpartyByCounterpartyIdLegacy(counterpartyId: CounterpartyId, callContext: Option[CallContext]): Box[(CounterpartyTrait, Option[CallContext])] = { Counterparties.counterparties.vend.getCounterparty(counterpartyId.value).map(counterparty => (counterparty, callContext)) } - override def getCounterpartyByCounterpartyId(counterpartyId: CounterpartyId, callContext: Option[CallContext]) = Future { + override def getCounterpartyByCounterpartyId(counterpartyId: CounterpartyId, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = Future { (Counterparties.counterparties.vend.getCounterparty(counterpartyId.value), callContext) } - override def getCounterpartyByIban(iban: String, callContext: Option[CallContext]) = { + override def getCounterpartyByIban(iban: String, callContext: Option[CallContext]): OBPReturnType[Box[CounterpartyTrait]] = { Future(Counterparties.counterparties.vend.getCounterpartyByIban(iban), callContext) } - override def getPhysicalCards(user: User) = { + override def getPhysicalCards(user: User): Box[List[PhysicalCard]] = { val list = code.cards.PhysicalCard.physicalCardProvider.vend.getPhysicalCards(user) val cardList = for (l <- list) yield - new PhysicalCard( + PhysicalCard( cardId = l.cardId, bankId = l.bankId, bankCardNumber = l.bankCardNumber, @@ -767,14 +762,14 @@ object LocalMappedConnector extends Connector with MdcLoggable { Full(cardList) } - override def getPhysicalCardsForBank(bank: Bank, user: User, queryParams: List[OBPQueryParam], callContext: Option[CallContext]) = Future { + override def getPhysicalCardsForBank(bank: Bank, user: User, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[PhysicalCard]]] = Future { ( getPhysicalCardsForBankLegacy(bank: Bank, user: User, queryParams), callContext ) } - override def getPhysicalCardsForBankLegacy(bank: Bank, user: User, queryParams: List[OBPQueryParam]) = { + override def getPhysicalCardsForBankLegacy(bank: Bank, user: User, queryParams: List[OBPQueryParam]): Box[List[PhysicalCard]] = { val list = code.cards.PhysicalCard.physicalCardProvider.vend.getPhysicalCardsForBank(bank, user, queryParams) val cardList = for (l <- list) yield new PhysicalCard( @@ -803,12 +798,12 @@ object LocalMappedConnector extends Connector with MdcLoggable { Full(cardList) } - override def getPhysicalCardForBank(bankId: BankId, cardId: String, callContext: Option[CallContext]) = Future { + override def getPhysicalCardForBank(bankId: BankId, cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCardTrait]] = Future { (code.cards.PhysicalCard.physicalCardProvider.vend.getPhysicalCardForBank(bankId: BankId, cardId: String, callContext), callContext) } - override def deletePhysicalCardForBank(bankId: BankId, cardId: String, callContext: Option[CallContext]) = Future { + override def deletePhysicalCardForBank(bankId: BankId, cardId: String, callContext: Option[CallContext]): OBPReturnType[Box[Boolean]] = Future { (code.cards.PhysicalCard.physicalCardProvider.vend.deletePhysicalCardForBank(bankId: BankId, cardId: String, callContext), callContext) } @@ -834,7 +829,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { collected: Option[CardCollectionInfo], posted: Option[CardPostedInfo], customerId: String, - callContext: Option[CallContext]) = Future { + callContext: Option[CallContext]): OBPReturnType[Box[PhysicalCard]] = Future { (createPhysicalCardLegacy( bankCardNumber: String, nameOnCard: String, @@ -955,7 +950,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { posted: Option[CardPostedInfo], customerId: String, callContext: Option[CallContext] - ) = Future { + ): OBPReturnType[Box[PhysicalCardTrait]] = Future { ( code.cards.PhysicalCard.physicalCardProvider.vend.updatePhysicalCard( cardId: String, @@ -983,7 +978,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { callContext) } - override def getCardAttributeById(cardAttributeId: String, callContext: Option[CallContext]) = { + override def getCardAttributeById(cardAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[CardAttribute]] = { CardAttributeX.cardAttributeProvider.vend.getCardAttributeById(cardAttributeId: String) map { (_, callContext) } @@ -1118,7 +1113,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { transactionRequestType: String, chargePolicy: String, callContext: Option[CallContext] - ) = Future { + ): Future[(Box[TransactionId], Option[CallContext])] = Future { ( for { currency <- Full(fromAccount.currency) @@ -1289,7 +1284,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { branchId: String, accountRoutingScheme: String, accountRoutingAddress: String - ) = { + ): Box[(Bank, BankAccount)] = { //don't require and exact match on the name, just the identifier val bank = MappedBank.find(By(MappedBank.national_identifier, bankNationalIdentifier)) match { case Full(b) => @@ -1343,14 +1338,14 @@ object LocalMappedConnector extends Connector with MdcLoggable { } //for sandbox use -> allows us to check if we can generate a new test account with the given number - override def accountExists(bankId: BankId, accountNumber: String) = { + override def accountExists(bankId: BankId, accountNumber: String): Box[Boolean] = { Full(MappedBankAccount.count( By(MappedBankAccount.bank, bankId.value), By(MappedBankAccount.accountNumber, accountNumber)) > 0) } //remove an account and associated transactions - override def removeAccount(bankId: BankId, accountId: AccountId) = { + override def removeAccount(bankId: BankId, accountId: AccountId): Box[Boolean] = { //delete comments on transactions of this account val commentsDeleted = Comments.comments.vend.bulkDeleteComments(bankId, accountId) @@ -1542,7 +1537,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { */ //used by the transaction import api - override def updateAccountBalance(bankId: BankId, accountId: AccountId, newBalance: BigDecimal) = { + override def updateAccountBalance(bankId: BankId, accountId: AccountId, newBalance: BigDecimal): Box[Boolean] = { //this will be Full(true) if everything went well val result = for { bank <- getMappedBank(bankId) @@ -1575,7 +1570,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { } //used by transaction import api call to check for duplicates - override def getMatchingTransactionCount(bankNationalIdentifier: String, accountNumber: String, amount: String, completed: Date, otherAccountHolder: String) = { + override def getMatchingTransactionCount(bankNationalIdentifier: String, accountNumber: String, amount: String, completed: Date, otherAccountHolder: String): Box[Int] = { //we need to convert from the legacy bankNationalIdentifier to BankId, and from the legacy accountNumber to AccountId val count = for { bankId <- getBankByNationalIdentifier(bankNationalIdentifier).map(_.bankId) @@ -1637,7 +1632,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { } yield transaction } - override def setBankAccountLastUpdated(bankNationalIdentifier: String, accountNumber: String, updateDate: Date) = { + override def setBankAccountLastUpdated(bankNationalIdentifier: String, accountNumber: String, updateDate: Date): Box[Boolean] = { val result = for { bankId <- getBankByNationalIdentifier(bankNationalIdentifier).map(_.bankId) account <- getAccountByNumber(bankId, accountNumber) @@ -1659,7 +1654,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { */ - override def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String) = { + override def updateAccountLabel(bankId: BankId, accountId: AccountId, label: String): Box[Boolean] = { //this will be Full(true) if everything went well val result = for { acc <- getBankAccountOld(bankId, accountId).map(_.asInstanceOf[MappedBankAccount]) @@ -1671,7 +1666,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { Full(result.getOrElse(false)) } - override def getProducts(bankId: BankId, params: Map[String, List[String]]): Box[List[MappedProduct]] = { + override def getProducts(bankId: BankId, params: Map[String, List[String]]): Box[List[Product]] = { Box !! { if (params.isEmpty) { MappedProduct.findAll(By(MappedProduct.mBankId, bankId.value)) @@ -1695,7 +1690,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { } } - override def getProduct(bankId: BankId, productCode: ProductCode): Box[MappedProduct] = { + override def getProduct(bankId: BankId, productCode: ProductCode): Box[Product] = { MappedProduct.find( By(MappedProduct.mBankId, bankId.value), By(MappedProduct.mCode, productCode.value) @@ -1815,13 +1810,13 @@ object LocalMappedConnector extends Connector with MdcLoggable { logger.info("before create or update branch") - val foundBranch: Box[MappedBranch] = getBranchLegacy(branch.bankId, branch.branchId) + val foundBranch: Box[BranchT] = getBranchLegacy(branch.bankId, branch.branchId) logger.info("after getting") //check the branch existence and update or insert data val branchToReturn = foundBranch match { - case Full(mappedBranch) => + case Full(mappedBranch: MappedBranch) => tryo { // Update... logger.info("We found a branch so update...") @@ -1990,7 +1985,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { //check the atm existence and update or insert data getAtmLegacy(atm.bankId, atm.atmId) match { - case Full(mappedAtm) => + case Full(mappedAtm: MappedAtm) => tryo { mappedAtm.mName(atm.name) .mLine1(atm.address.line1) @@ -2094,7 +2089,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { //check the product existence and update or insert data getProduct(BankId(bankId), ProductCode(code)) match { - case Full(mappedProduct) => + case Full(mappedProduct: MappedProduct) => tryo { parentProductCode match { case Some(ppc) => mappedProduct.mParentProductCode(ppc) @@ -2140,7 +2135,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { } - override def getBranchLegacy(bankId: BankId, branchId: BranchId): Box[MappedBranch] = { + override def getBranchLegacy(bankId: BankId, branchId: BranchId): Box[BranchT] = { MappedBranch .find( By(MappedBranch.mBankId, bankId.value), @@ -2154,31 +2149,31 @@ object LocalMappedConnector extends Connector with MdcLoggable { ) } - override def getBranches(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]) = { + override def getBranches(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[(List[BranchT], Option[CallContext])]] = { Future { Full(MappedBranch.findAll(By(MappedBranch.mBankId, bankId.value)), callContext) } } - override def getBranch(bankId: BankId, branchId: BranchId, callContext: Option[CallContext]) = { + override def getBranch(bankId: BankId, branchId: BranchId, callContext: Option[CallContext]): Future[Box[(BranchT, Option[CallContext])]] = { Future { getBranchLegacy(bankId, branchId).map(branch => (branch, callContext)) } } - override def getAtmLegacy(bankId: BankId, atmId: AtmId): Box[MappedAtm] = { + override def getAtmLegacy(bankId: BankId, atmId: AtmId): Box[AtmT] = { MappedAtm .find( By(MappedAtm.mBankId, bankId.value), By(MappedAtm.mAtmId, atmId.value)) } - override def getAtm(bankId: BankId, atmId: AtmId, callContext: Option[CallContext]) = + override def getAtm(bankId: BankId, atmId: AtmId, callContext: Option[CallContext]): Future[Box[(AtmT, Option[CallContext])]] = Future { getAtmLegacy(bankId, atmId).map(atm => (atm, callContext)) } - override def getAtms(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]) = { + override def getAtms(bankId: BankId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Future[Box[(List[AtmT], Option[CallContext])]] = { Future { Full(MappedAtm.findAll(By(MappedAtm.mBankId, bankId.value)), callContext) } @@ -2370,7 +2365,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { bankId: BankId, customerNumber: String, callContext: Option[CallContext] - ) = Future { + ): OBPReturnType[Box[Boolean]] = Future { (tryo { CustomerX.customerProvider.vend.checkCustomerNumberAvailable(bankId, customerNumber) }, callContext) @@ -2398,7 +2393,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { branchId: String, nameSuffix: String, callContext: Option[CallContext] - ) = Future { + ): OBPReturnType[Box[Customer]] = Future { (CustomerX.customerProvider.vend.addCustomer( bankId, Random.nextInt(Integer.MAX_VALUE).toString, @@ -2600,7 +2595,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { bankId: String, accountId: String, callContext: Option[CallContext] - ) = Future { + ): Future[Box[(CheckbookOrdersJson, Option[CallContext])]] = Future { Full(SwaggerDefinitionsJSON.checkbookOrdersJson, callContext) } @@ -2609,7 +2604,7 @@ object LocalMappedConnector extends Connector with MdcLoggable { bankId: String, accountId: String, callContext: Option[CallContext] - ) = Future { + ): Future[Box[(List[CardObjectJson], Option[CallContext])]] = Future { Full(List(SwaggerDefinitionsJSON.cardObjectJson), callContext) } @@ -2691,12 +2686,12 @@ object LocalMappedConnector extends Connector with MdcLoggable { (_, callContext) } - override def getAccountAttributeById(accountAttributeId: String, callContext: Option[CallContext]) = + override def getAccountAttributeById(accountAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[AccountAttribute]] = AccountAttributeX.accountAttributeProvider.vend.getAccountAttributeById(accountAttributeId: String) map { (_, callContext) } - override def getTransactionAttributeById(transactionAttributeId: String, callContext: Option[CallContext]) = + override def getTransactionAttributeById(transactionAttributeId: String, callContext: Option[CallContext]): OBPReturnType[Box[TransactionAttribute]] = TransactionAttributeX.transactionAttributeProvider.vend.getTransactionAttributeById(transactionAttributeId: String) map { (_, callContext) } @@ -2862,10 +2857,12 @@ object LocalMappedConnector extends Connector with MdcLoggable { override def getCustomerAttributesForCustomers( customers: List[Customer], - callContext: Option[CallContext]): OBPReturnType[Box[List[(Customer, List[CustomerAttribute])]]] = { - CustomerAttributeX.customerAttributeProvider.vend.getCustomerAttributesForCustomers( - customers: List[Customer]) map { - (_, callContext) + callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAndAttribute]]] = { + CustomerAttributeX.customerAttributeProvider.vend.getCustomerAttributesForCustomers(customers: List[Customer]) map { + case Full(list) => + val customerAndAttributes: List[CustomerAndAttribute] = list.map(it => CustomerAndAttribute(it.customer, it.attributes)) + (Full(customerAndAttributes), callContext) + case x => (x.asInstanceOf[Box[List[CustomerAndAttribute]]], callContext) } } diff --git a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala index a0f0e9520..86c140051 100644 --- a/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala +++ b/obp-api/src/main/scala/code/bankconnectors/akka/AkkaConnector_vDec2018.scala @@ -4309,7 +4309,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { exampleInboundMessage = ( InBoundGetCustomerAttributesForCustomers(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, - value= List( + data = List( CustomerAndAttribute( MessageDocsSwaggerDefinitions.customerCommons, List(MessageDocsSwaggerDefinitions.customerAttribute) @@ -4320,11 +4320,11 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit { adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - override def getCustomerAttributesForCustomers(customers: List[Customer], callContext: Option[CallContext]): OBPReturnType[Box[List[(Customer, List[CustomerAttribute])]]] = { + override def getCustomerAttributesForCustomers(customers: List[Customer], callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAndAttribute]]] = { import com.openbankproject.commons.dto.{OutBoundGetCustomerAttributesForCustomers => OutBound, InBoundGetCustomerAttributesForCustomers => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customers) val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _) - response.map(convertToTuple[List[(Customer, List[CustomerAttribute])]](callContext)) + response.map(convertToTuple[List[CustomerAndAttribute]](callContext)) } messageDocs += getTransactionIdsByAttributeNameValuesDoc diff --git a/obp-api/src/main/scala/code/bankconnectors/akka/actor/SouthSideActorOfAkkaConnector.scala b/obp-api/src/main/scala/code/bankconnectors/akka/actor/SouthSideActorOfAkkaConnector.scala index 19517b521..536246bb5 100644 --- a/obp-api/src/main/scala/code/bankconnectors/akka/actor/SouthSideActorOfAkkaConnector.scala +++ b/obp-api/src/main/scala/code/bankconnectors/akka/actor/SouthSideActorOfAkkaConnector.scala @@ -42,11 +42,11 @@ class SouthSideActorOfAkkaConnector extends Actor with ActorLogging with MdcLogg sender ! result case OutBoundGetBanks(cc) => - val result: Box[List[MappedBank]] = getBanksLegacy(None).map(r => r._1) + val result: Box[List[Bank]] = getBanksLegacy(None).map(r => r._1) sender ! InBoundGetBanks(InboundAdapterCallContext(cc.correlationId,cc.sessionId,cc.generalContext),successInBoundStatus, result.map(l => l.map(Transformer.bank(_))).openOrThrowException(attemptedToOpenAnEmptyBox)) case OutBoundGetBank(cc, bankId) => - val result: Box[MappedBank] = getBankLegacy(bankId, None).map(r => r._1) + val result: Box[Bank] = getBankLegacy(bankId, None).map(r => r._1) sender ! InBoundGetBank(InboundAdapterCallContext(cc.correlationId,cc.sessionId,cc.generalContext), successInBoundStatus, result.map(Transformer.bank(_)).openOrThrowException(attemptedToOpenAnEmptyBox) ) case OutBoundCheckBankAccountExists(cc, bankId, accountId) => @@ -84,7 +84,7 @@ class SouthSideActorOfAkkaConnector extends Actor with ActorLogging with MdcLogg object Transformer { - def bank(mb: MappedBank): BankCommons = + def bank(mb: Bank): BankCommons = BankCommons( bankId=mb.bankId, shortName=mb.shortName, diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala index f8c525432..f720ca5ea 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala @@ -4527,7 +4527,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { exampleInboundMessage = ( InBoundGetCustomerAttributesForCustomers(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, - value= List( + data = List( CustomerAndAttribute( MessageDocsSwaggerDefinitions.customerCommons, List(MessageDocsSwaggerDefinitions.customerAttribute) @@ -4538,11 +4538,11 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) - override def getCustomerAttributesForCustomers(customers: List[Customer], callContext: Option[CallContext]): OBPReturnType[Box[List[(Customer, List[CustomerAttribute])]]] = { + override def getCustomerAttributesForCustomers(customers: List[Customer], callContext: Option[CallContext]): OBPReturnType[Box[List[CustomerAndAttribute]]] = { import com.openbankproject.commons.dto.{OutBoundGetCustomerAttributesForCustomers => OutBound, InBoundGetCustomerAttributesForCustomers => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customers) val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_customer_attributes_for_customers", req, callContext) - response.map(convertToTuple[List[(Customer, List[CustomerAttribute])]](callContext)) + response.map(convertToTuple[List[CustomerAndAttribute]](callContext)) } messageDocs += getTransactionIdsByAttributeNameValuesDoc diff --git a/obp-api/src/main/scala/code/customerattribute/CustomerAttribute.scala b/obp-api/src/main/scala/code/customerattribute/CustomerAttribute.scala index b718a444b..8a61cd628 100644 --- a/obp-api/src/main/scala/code/customerattribute/CustomerAttribute.scala +++ b/obp-api/src/main/scala/code/customerattribute/CustomerAttribute.scala @@ -4,6 +4,7 @@ package code.customerattribute import code.api.util.APIUtil import code.remotedata.RemotedataCustomerAttribute +import com.openbankproject.commons.dto.CustomerAndAttribute import com.openbankproject.commons.model.enums.CustomerAttributeType import com.openbankproject.commons.model.{BankId, Customer, CustomerAttribute, CustomerId} import net.liftweb.common.{Box, Logger} @@ -44,7 +45,7 @@ trait CustomerAttributeProvider { def getCustomerIdsByAttributeNameValues(bankId: BankId, params: Map[String, List[String]]): Future[Box[List[String]]] - def getCustomerAttributesForCustomers(customers: List[Customer]): Future[Box[List[(Customer, List[CustomerAttribute])]]] + def getCustomerAttributesForCustomers(customers: List[Customer]): Future[Box[List[CustomerAndAttribute]]] def getCustomerAttributeById(customerAttributeId: String): Future[Box[CustomerAttribute]] diff --git a/obp-api/src/main/scala/code/customerattribute/MappedCustomerAttributeProvider.scala b/obp-api/src/main/scala/code/customerattribute/MappedCustomerAttributeProvider.scala index 45ec643a0..ca99859a3 100644 --- a/obp-api/src/main/scala/code/customerattribute/MappedCustomerAttributeProvider.scala +++ b/obp-api/src/main/scala/code/customerattribute/MappedCustomerAttributeProvider.scala @@ -1,6 +1,7 @@ package code.customerattribute import code.util.{AttributeQueryTrait, MappedUUID, UUIDString} +import com.openbankproject.commons.dto.CustomerAndAttribute import com.openbankproject.commons.model.enums.CustomerAttributeType import com.openbankproject.commons.model.{BankId, Customer, CustomerAttribute, CustomerId} import net.liftweb.common.{Box, Empty, Full} @@ -56,10 +57,10 @@ object MappedCustomerAttributeProvider extends CustomerAttributeProvider { } } - def getCustomerAttributesForCustomers(customers: List[Customer]): Future[Box[List[(Customer, List[CustomerAttribute])]]] = { + def getCustomerAttributesForCustomers(customers: List[Customer]): Future[Box[List[CustomerAndAttribute]]] = { Future { Box !! customers.map( customer => - ( + CustomerAndAttribute( customer, MappedCustomerAttribute.findAll( By(MappedCustomerAttribute.mBankId, customer.bankId), diff --git a/obp-api/src/main/scala/code/remotedata/RemotedataCustomerAttribute.scala b/obp-api/src/main/scala/code/remotedata/RemotedataCustomerAttribute.scala index 821669f2a..31e02f0e9 100644 --- a/obp-api/src/main/scala/code/remotedata/RemotedataCustomerAttribute.scala +++ b/obp-api/src/main/scala/code/remotedata/RemotedataCustomerAttribute.scala @@ -3,6 +3,7 @@ package code.remotedata import akka.pattern.ask import code.customerattribute.{CustomerAttributeProvider, MappedCustomerAttribute, RemotedataCustomerAttributeCaseClasses} import code.actorsystem.ObpActorInit +import com.openbankproject.commons.dto.CustomerAndAttribute import com.openbankproject.commons.model._ import com.openbankproject.commons.model.enums.CustomerAttributeType import net.liftweb.common.Box @@ -25,8 +26,8 @@ object RemotedataCustomerAttribute extends ObpActorInit with CustomerAttributePr override def getCustomerIdsByAttributeNameValues(bankId: BankId, params: Map[String, List[String]]): Future[Box[List[String]]] = (actor ? cc.getCustomerIdsByAttributeNameValues(bankId, params)).mapTo[Box[List[String]]] - override def getCustomerAttributesForCustomers(customers: List[Customer]): Future[Box[List[(Customer, List[CustomerAttribute])]]] = - (actor ? cc.getCustomerAttributesForCustomers(customers: List[Customer])).mapTo[Box[List[(Customer, List[CustomerAttribute])]]] + override def getCustomerAttributesForCustomers(customers: List[Customer]): Future[Box[List[CustomerAndAttribute]]] = + (actor ? cc.getCustomerAttributesForCustomers(customers: List[Customer])).mapTo[Box[List[CustomerAndAttribute]]] override def getCustomerAttributeById(customerAttributeId: String): Future[Box[CustomerAttribute]] = (actor ? cc.getCustomerAttributeById(customerAttributeId)).mapTo[Box[CustomerAttribute]] diff --git a/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala b/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala index 0e75df8df..a2e9e2f50 100644 --- a/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala +++ b/obp-commons/src/main/scala/com/openbankproject/commons/dto/JsonsTransfer.scala @@ -1265,11 +1265,9 @@ case class InBoundGetCustomerAttributes(inboundAdapterCallContext: InboundAdapte case class OutBoundGetCustomerIdsByAttributeNameValues(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, nameValues: Map[String,List[String]]) extends TopicTrait case class InBoundGetCustomerIdsByAttributeNameValues(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[String]) extends InBoundTrait[List[String]] -case class CustomerAndAttribute(customer: CustomerCommons, attributes: List[CustomerAttributeCommons]) +case class CustomerAndAttribute(customer: Customer, attributes: List[CustomerAttribute]) case class OutBoundGetCustomerAttributesForCustomers(outboundAdapterCallContext: OutboundAdapterCallContext, customers: List[Customer]) extends TopicTrait -case class InBoundGetCustomerAttributesForCustomers(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, value: List[CustomerAndAttribute]) extends InBoundTrait[List[(Customer, List[CustomerAttribute])]] { - override val data: List[(Customer, List[CustomerAttribute])] = value.map(it => (it.customer, it.attributes)) -} +case class InBoundGetCustomerAttributesForCustomers(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[CustomerAndAttribute]) extends InBoundTrait[List[CustomerAndAttribute]] case class OutBoundGetTransactionIdsByAttributeNameValues(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, nameValues: Map[String,List[String]]) extends TopicTrait case class InBoundGetTransactionIdsByAttributeNameValues(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[String]) extends InBoundTrait[List[String]] From 26654f770c1dd8f7d4b4dcd39caadfaff61eefea Mon Sep 17 00:00:00 2001 From: shuang Date: Tue, 14 Jul 2020 16:21:17 +0800 Subject: [PATCH 2/3] feature/ignore_Inbound_field_value_for_unit_test: rebuild StoredProcedureConnector_vDec2019 and MSsqlStoredProcedure.sql --- .../code/api/util/CodeGenerateUtils.scala | 5 +- .../storedprocedure/MSsqlStoredProcedure.sql | 161 +++++++- .../StoredProcedureConnector_vDec2019.scala | 354 +++++++++--------- 3 files changed, 330 insertions(+), 190 deletions(-) diff --git a/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala b/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala index a8932ff0a..0154ab8ba 100644 --- a/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala +++ b/obp-api/src/main/scala/code/api/util/CodeGenerateUtils.scala @@ -48,6 +48,7 @@ object CodeGenerateUtils { NameTypeExample(null, typeOf[InboundAdapterCallContext], "MessageDocsSwaggerDefinitions.inboundAdapterCallContext"), NameTypeExample("status", typeOf[Status], "MessageDocsSwaggerDefinitions.inboundStatus"), NameTypeExample("statusValue", typeOf[String], s""""${TransactionRequestStatus.COMPLETED}""""), + NameTypeExample("hashOfSuppliedAnswer", typeOf[String], s"""HashUtil.Sha256Hash("123")"""), NameTypeExample(null, typeOf[List[CustomerAndAttribute]], """ List( | CustomerAndAttribute( @@ -255,6 +256,7 @@ object CodeGenerateUtils { private def getExampleValue(name: String, otherNames: String*): Option[String] = (name +: otherNames).collectFirst { + case x if exampleNameToValue.contains(x + "Example") => exampleNameToValue(x + "Example") case x if exampleNameToValue.contains(x) => exampleNameToValue(x) } @@ -263,8 +265,7 @@ object CodeGenerateUtils { */ private lazy val exampleNameToValue: Map[String, String] = { ExampleValue.exampleNameToValue.keys.map(exampleName => { - val removePostfixName = StringUtils.removeEnd(exampleName, "Example") - (removePostfixName, s"$exampleName.value") + (exampleName, s"$exampleName.value") }).toMap } diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql index 9ae7fce63..dbc20010c 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/MSsqlStoredProcedure.sql @@ -1,4 +1,4 @@ --- auto generated MS sql server procedures script, create on 2020-07-06T11:29:05Z +-- auto generated MS sql server procedures script, create on 2020-07-14T08:19:17Z -- drop procedure obp_get_adapter_info DROP PROCEDURE IF EXISTS obp_get_adapter_info; @@ -321,7 +321,7 @@ this is example of parameter @outbound_json "correlationId":"1flssoftxq0cr1nssr68u0mioj" }, "challengeId":"string", - "hashOfSuppliedAnswer":"string" + "hashOfSuppliedAnswer":"a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3" }' */ @@ -1646,18 +1646,29 @@ this is example of parameter @outbound_json "balance":"50.89", "currency":"EUR", "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" }, "lastUpdate":"2018-03-09T00:00:00Z", "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", "accountRoutings":[ { "scheme":"IBAN", "address":"DE91 1000 0000 0123 4567 89" } - ] + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" }, "otherAccount":{ "kind":"Counterparty kind string", @@ -1865,18 +1876,29 @@ this is example of parameter @outbound_json "balance":"50.89", "currency":"EUR", "name":"bankAccount name string", + "label":"My Account", + "iban":"DE91 1000 0000 0123 4567 89", "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" }, "lastUpdate":"2018-03-09T00:00:00Z", "branchId":"DERBY6", + "accountRoutingScheme":"IBAN", + "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", "accountRoutings":[ { "scheme":"IBAN", "address":"DE91 1000 0000 0123 4567 89" } - ] + ], + "accountRules":[ + { + "scheme":"AccountRule scheme string", + "value":"AccountRule value string" + } + ], + "accountHolder":"bankAccount accountHolder string" }, "otherAccount":{ "kind":"Counterparty kind string", @@ -2547,9 +2569,22 @@ this is example of parameter @outbound_json "accountId":{ "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" - } + }, + "lastUpdate":"2018-03-09T00:00:00Z", + "branchId":"DERBY6", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ] }, "toAccount":{ "accountId":{ @@ -2651,9 +2686,22 @@ this is example of parameter @outbound_json "accountId":{ "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" - } + }, + "lastUpdate":"2018-03-09T00:00:00Z", + "branchId":"DERBY6", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ] }, "toAccount":{ "accountId":{ @@ -2786,13 +2834,26 @@ this is example of parameter @outbound_json "accountId":{ "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", "label":"My Account", "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" }, + "lastUpdate":"2018-03-09T00:00:00Z", + "branchId":"DERBY6", "accountRoutingScheme":"IBAN", "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], "accountRules":[ { "scheme":"AccountRule scheme string", @@ -2940,13 +3001,26 @@ this is example of parameter @outbound_json "accountId":{ "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", "label":"My Account", "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" }, + "lastUpdate":"2018-03-09T00:00:00Z", + "branchId":"DERBY6", "accountRoutingScheme":"IBAN", "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], "accountRules":[ { "scheme":"AccountRule scheme string", @@ -3122,9 +3196,22 @@ this is example of parameter @outbound_json "accountId":{ "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" - } + }, + "lastUpdate":"2018-03-09T00:00:00Z", + "branchId":"DERBY6", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ] }, "transactionRequest":{ "id":{ @@ -4026,9 +4113,22 @@ this is example of parameter @outbound_json "accountId":{ "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" - } + }, + "lastUpdate":"2018-03-09T00:00:00Z", + "branchId":"DERBY6", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ] }, "transReqId":{ "value":"8138a7e4-6d02-40e3-a129-0b2bf89de9f1" @@ -4129,9 +4229,22 @@ this is example of parameter @outbound_json "accountId":{ "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" - } + }, + "lastUpdate":"2018-03-09T00:00:00Z", + "branchId":"DERBY6", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ] }, "toAccount":{ "accountId":{ @@ -4255,9 +4368,22 @@ this is example of parameter @outbound_json "accountId":{ "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", + "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" - } + }, + "lastUpdate":"2018-03-09T00:00:00Z", + "branchId":"DERBY6", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ] }, "toAccount":{ "accountId":{ @@ -7057,7 +7183,7 @@ this is example of parameter @outbound_json } ] }, - "value":[ + "data":[ { "customer":{ "customerId":"7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh", @@ -8914,13 +9040,26 @@ this is example of parameter @outbound_json "accountId":{ "value":"8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0" }, + "accountType":"AC", + "balance":"50.89", + "currency":"EUR", + "name":"bankAccount name string", "label":"My Account", "iban":"DE91 1000 0000 0123 4567 89", + "number":"bankAccount number string", "bankId":{ "value":"gh.29.uk" }, + "lastUpdate":"2018-03-09T00:00:00Z", + "branchId":"DERBY6", "accountRoutingScheme":"IBAN", "accountRoutingAddress":"DE91 1000 0000 0123 4567 89", + "accountRoutings":[ + { + "scheme":"IBAN", + "address":"DE91 1000 0000 0123 4567 89" + } + ], "accountRules":[ { "scheme":"AccountRule scheme string", diff --git a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala index f720ca5ea..6f66b9d10 100644 --- a/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala +++ b/obp-api/src/main/scala/code/bankconnectors/storedprocedure/StoredProcedureConnector_vDec2019.scala @@ -74,7 +74,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { val connectorName = "stored_procedure_vDec2019" //---------------- dynamic start -------------------please don't modify this line -// ---------- created on 2020-07-02T16:06:15Z +// ---------- created on 2020-07-14T16:11:11Z messageDocs += getAdapterInfoDoc def getAdapterInfoDoc = MessageDoc( @@ -456,7 +456,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -501,7 +501,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -544,7 +544,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -588,7 +588,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -632,7 +632,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -676,7 +676,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { amount=balanceAmountExample.value))), overallBalance= AmountOfMoney(currency=currencyExample.value, amount=amountExample.value), - overallBalanceDate=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")))) + overallBalanceDate=toDate(dateExample))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) @@ -775,7 +775,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1001,7 +1001,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1026,8 +1026,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { amount=BigDecimal(transactionAmountExample.value), currency=currencyExample.value, description=Some(transactionDescriptionExample.value), - startDate=parseDate(transactionStartDateExample.value).getOrElse(sys.error("transactionStartDateExample.value is not valid date format.")), - finishDate=parseDate(transactionFinishDateExample.value).getOrElse(sys.error("transactionFinishDateExample.value is not valid date format.")), + startDate=toDate(transactionStartDateExample), + finishDate=toDate(transactionFinishDateExample), balance=BigDecimal(balanceAmountExample.value)))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -1069,7 +1069,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1093,8 +1093,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { amount=BigDecimal(amountExample.value), currency=currencyExample.value, description=Some("string"), - startDate=parseDate(startDateExample.value).getOrElse(sys.error("startDateExample.value is not valid date format.")), - finishDate=parseDate(finishDateExample.value).getOrElse(sys.error("finishDateExample.value is not valid date format.")), + startDate=toDate(startDateExample), + finishDate=toDate(finishDateExample), balance=BigDecimal(balanceAmountExample.value)))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -1134,7 +1134,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1159,8 +1159,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { amount=BigDecimal(transactionAmountExample.value), currency=currencyExample.value, description=Some(transactionDescriptionExample.value), - startDate=parseDate(transactionStartDateExample.value).getOrElse(sys.error("transactionStartDateExample.value is not valid date format.")), - finishDate=parseDate(transactionFinishDateExample.value).getOrElse(sys.error("transactionFinishDateExample.value is not valid date format.")), + startDate=toDate(transactionStartDateExample), + finishDate=toDate(transactionFinishDateExample), balance=BigDecimal(balanceAmountExample.value))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -1195,8 +1195,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { nameOnCard=nameOnCardExample.value, issueNumber=issueNumberExample.value, serialNumber=serialNumberExample.value, - validFrom=parseDate(validFromDateExample.value).getOrElse(sys.error("validFromDateExample.value is not valid date format.")), - expires=parseDate(expiresDateExample.value).getOrElse(sys.error("expiresDateExample.value is not valid date format.")), + validFrom=toDate(validFromDateExample), + expires=toDate(expiresDateExample), enabled=true, cancelled=true, onHotList=true, @@ -1212,7 +1212,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=accountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1221,12 +1221,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, value=accountRuleValueExample.value)), accountHolder=bankAccountAccountHolderExample.value), - replacement=Some( CardReplacementInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + replacement=Some( CardReplacementInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), - pinResets=List( PinResetInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + pinResets=List( PinResetInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), - collected=Some(CardCollectionInfo(parseDate(collectedDateExample.value).getOrElse(sys.error("collectedDateExample.value is not valid date format.")))), - posted=Some(CardPostedInfo(parseDate(postedDateExample.value).getOrElse(sys.error("postedDateExample.value is not valid date format.")))), + collected=Some(CardCollectionInfo(toDate(collectedDateExample))), + posted=Some(CardPostedInfo(toDate(postedDateExample))), customerId=customerIdExample.value)) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -1305,8 +1305,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { nameOnCard=nameOnCardExample.value, issueNumber=issueNumberExample.value, serialNumber=serialNumberExample.value, - validFrom=parseDate(validFromDateExample.value).getOrElse(sys.error("validFromDateExample.value is not valid date format.")), - expires=parseDate(expiresDateExample.value).getOrElse(sys.error("expiresDateExample.value is not valid date format.")), + validFrom=toDate(validFromDateExample), + expires=toDate(expiresDateExample), enabled=true, cancelled=true, onHotList=true, @@ -1322,7 +1322,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=accountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1331,12 +1331,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, value=accountRuleValueExample.value)), accountHolder=bankAccountAccountHolderExample.value), - replacement=Some( CardReplacementInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + replacement=Some( CardReplacementInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), - pinResets=List( PinResetInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + pinResets=List( PinResetInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), - collected=Some(CardCollectionInfo(parseDate(collectedDateExample.value).getOrElse(sys.error("collectedDateExample.value is not valid date format.")))), - posted=Some(CardPostedInfo(parseDate(postedDateExample.value).getOrElse(sys.error("postedDateExample.value is not valid date format.")))), + collected=Some(CardCollectionInfo(toDate(collectedDateExample))), + posted=Some(CardPostedInfo(toDate(postedDateExample))), customerId=customerIdExample.value))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -1363,8 +1363,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { cardType=cardTypeExample.value, issueNumber=issueNumberExample.value, serialNumber=serialNumberExample.value, - validFrom=parseDate(validFromDateExample.value).getOrElse(sys.error("validFromDateExample.value is not valid date format.")), - expires=parseDate(expiresDateExample.value).getOrElse(sys.error("expiresDateExample.value is not valid date format.")), + validFrom=toDate(validFromDateExample), + expires=toDate(expiresDateExample), enabled=true, cancelled=true, onHotList=true, @@ -1373,12 +1373,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { allows=List("string"), accountId=accountIdExample.value, bankId=bankIdExample.value, - replacement=Some( CardReplacementInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + replacement=Some( CardReplacementInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), - pinResets=List( PinResetInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + pinResets=List( PinResetInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), - collected=Some(CardCollectionInfo(parseDate(collectedDateExample.value).getOrElse(sys.error("collectedDateExample.value is not valid date format.")))), - posted=Some(CardPostedInfo(parseDate(postedDateExample.value).getOrElse(sys.error("postedDateExample.value is not valid date format.")))), + collected=Some(CardCollectionInfo(toDate(collectedDateExample))), + posted=Some(CardPostedInfo(toDate(postedDateExample))), customerId=customerIdExample.value) ), exampleInboundMessage = ( @@ -1391,8 +1391,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { nameOnCard=nameOnCardExample.value, issueNumber=issueNumberExample.value, serialNumber=serialNumberExample.value, - validFrom=parseDate(validFromDateExample.value).getOrElse(sys.error("validFromDateExample.value is not valid date format.")), - expires=parseDate(expiresDateExample.value).getOrElse(sys.error("expiresDateExample.value is not valid date format.")), + validFrom=toDate(validFromDateExample), + expires=toDate(expiresDateExample), enabled=true, cancelled=true, onHotList=true, @@ -1408,7 +1408,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=accountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1417,12 +1417,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, value=accountRuleValueExample.value)), accountHolder=bankAccountAccountHolderExample.value), - replacement=Some( CardReplacementInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + replacement=Some( CardReplacementInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), - pinResets=List( PinResetInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + pinResets=List( PinResetInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), - collected=Some(CardCollectionInfo(parseDate(collectedDateExample.value).getOrElse(sys.error("collectedDateExample.value is not valid date format.")))), - posted=Some(CardPostedInfo(parseDate(postedDateExample.value).getOrElse(sys.error("postedDateExample.value is not valid date format.")))), + collected=Some(CardCollectionInfo(toDate(collectedDateExample))), + posted=Some(CardPostedInfo(toDate(postedDateExample))), customerId=customerIdExample.value)) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -1450,8 +1450,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { cardType=cardTypeExample.value, issueNumber=issueNumberExample.value, serialNumber=serialNumberExample.value, - validFrom=parseDate(validFromDateExample.value).getOrElse(sys.error("validFromDateExample.value is not valid date format.")), - expires=parseDate(expiresDateExample.value).getOrElse(sys.error("expiresDateExample.value is not valid date format.")), + validFrom=toDate(validFromDateExample), + expires=toDate(expiresDateExample), enabled=true, cancelled=true, onHotList=true, @@ -1460,12 +1460,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { allows=List("string"), accountId=accountIdExample.value, bankId=bankIdExample.value, - replacement=Some( CardReplacementInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + replacement=Some( CardReplacementInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), - pinResets=List( PinResetInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + pinResets=List( PinResetInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), - collected=Some(CardCollectionInfo(parseDate(collectedDateExample.value).getOrElse(sys.error("collectedDateExample.value is not valid date format.")))), - posted=Some(CardPostedInfo(parseDate(postedDateExample.value).getOrElse(sys.error("postedDateExample.value is not valid date format.")))), + collected=Some(CardCollectionInfo(toDate(collectedDateExample))), + posted=Some(CardPostedInfo(toDate(postedDateExample))), customerId=customerIdExample.value) ), exampleInboundMessage = ( @@ -1478,8 +1478,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { nameOnCard=nameOnCardExample.value, issueNumber=issueNumberExample.value, serialNumber=serialNumberExample.value, - validFrom=parseDate(validFromDateExample.value).getOrElse(sys.error("validFromDateExample.value is not valid date format.")), - expires=parseDate(expiresDateExample.value).getOrElse(sys.error("expiresDateExample.value is not valid date format.")), + validFrom=toDate(validFromDateExample), + expires=toDate(expiresDateExample), enabled=true, cancelled=true, onHotList=true, @@ -1495,7 +1495,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=accountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1504,12 +1504,12 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, value=accountRuleValueExample.value)), accountHolder=bankAccountAccountHolderExample.value), - replacement=Some( CardReplacementInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + replacement=Some( CardReplacementInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.CardReplacementReason.FIRST)), - pinResets=List( PinResetInfo(requestedDate=parseDate(requestedDateExample.value).getOrElse(sys.error("requestedDateExample.value is not valid date format.")), + pinResets=List( PinResetInfo(requestedDate=toDate(requestedDateExample), reasonRequested=com.openbankproject.commons.model.PinResetReason.FORGOT)), - collected=Some(CardCollectionInfo(parseDate(collectedDateExample.value).getOrElse(sys.error("collectedDateExample.value is not valid date format.")))), - posted=Some(CardPostedInfo(parseDate(postedDateExample.value).getOrElse(sys.error("postedDateExample.value is not valid date format.")))), + collected=Some(CardCollectionInfo(toDate(collectedDateExample))), + posted=Some(CardPostedInfo(toDate(postedDateExample))), customerId=customerIdExample.value)) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -1540,7 +1540,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1558,7 +1558,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1615,7 +1615,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1633,7 +1633,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1660,7 +1660,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { account_id=account_idExample.value), body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id=bank_idExample.value, account_id=account_idExample.value)), - to_sepa=Some(TransactionRequestIban("string")), + to_sepa=Some(TransactionRequestIban(transactionRequestIban.value)), to_counterparty=Some(TransactionRequestCounterpartyId(transactionRequestCounterpartyIdExample.value)), to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, amount=amountExample.value), @@ -1700,8 +1700,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { description="string"), transaction_ids="string", status="string", - start_date=parseDate(transactionRequestStartDateExample.value).getOrElse(sys.error("transactionRequestStartDateExample.value is not valid date format.")), - end_date=parseDate(transactionRequestEndDateExample.value).getOrElse(sys.error("transactionRequestEndDateExample.value is not valid date format.")), + start_date=toDate(transactionRequestStartDateExample), + end_date=toDate(transactionRequestEndDateExample), challenge= TransactionRequestChallenge(id="string", allowed_attempts=123, challenge_type="string"), @@ -1756,7 +1756,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1774,7 +1774,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1801,7 +1801,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { account_id=account_idExample.value), body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id=bank_idExample.value, account_id=account_idExample.value)), - to_sepa=Some(TransactionRequestIban("string")), + to_sepa=Some(TransactionRequestIban(transactionRequestIban.value)), to_counterparty=Some(TransactionRequestCounterpartyId(transactionRequestCounterpartyIdExample.value)), to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, amount=amountExample.value), @@ -1841,8 +1841,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { description="string"), transaction_ids="string", status="string", - start_date=parseDate(transactionRequestStartDateExample.value).getOrElse(sys.error("transactionRequestStartDateExample.value is not valid date format.")), - end_date=parseDate(transactionRequestEndDateExample.value).getOrElse(sys.error("transactionRequestEndDateExample.value is not valid date format.")), + start_date=toDate(transactionRequestStartDateExample), + end_date=toDate(transactionRequestEndDateExample), challenge= TransactionRequestChallenge(id="string", allowed_attempts=123, challenge_type="string"), @@ -1896,7 +1896,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -1915,7 +1915,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { account_id=account_idExample.value), body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id=bank_idExample.value, account_id=account_idExample.value)), - to_sepa=Some(TransactionRequestIban("string")), + to_sepa=Some(TransactionRequestIban(transactionRequestIban.value)), to_counterparty=Some(TransactionRequestCounterpartyId(transactionRequestCounterpartyIdExample.value)), to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, amount=amountExample.value), @@ -1955,8 +1955,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { description="string"), transaction_ids="string", status="string", - start_date=parseDate(transactionRequestStartDateExample.value).getOrElse(sys.error("transactionRequestStartDateExample.value is not valid date format.")), - end_date=parseDate(transactionRequestEndDateExample.value).getOrElse(sys.error("transactionRequestEndDateExample.value is not valid date format.")), + start_date=toDate(transactionRequestStartDateExample), + end_date=toDate(transactionRequestEndDateExample), challenge= TransactionRequestChallenge(id="string", allowed_attempts=123, challenge_type="string"), @@ -2006,7 +2006,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { account_id=account_idExample.value), body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id=bank_idExample.value, account_id=account_idExample.value)), - to_sepa=Some(TransactionRequestIban("string")), + to_sepa=Some(TransactionRequestIban(transactionRequestIban.value)), to_counterparty=Some(TransactionRequestCounterpartyId(transactionRequestCounterpartyIdExample.value)), to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, amount=amountExample.value), @@ -2046,8 +2046,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { description="string"), transaction_ids="string", status="string", - start_date=parseDate(transactionRequestStartDateExample.value).getOrElse(sys.error("transactionRequestStartDateExample.value is not valid date format.")), - end_date=parseDate(transactionRequestEndDateExample.value).getOrElse(sys.error("transactionRequestEndDateExample.value is not valid date format.")), + start_date=toDate(transactionRequestStartDateExample), + end_date=toDate(transactionRequestEndDateExample), challenge= TransactionRequestChallenge(id="string", allowed_attempts=123, challenge_type="string"), @@ -2095,7 +2095,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -2110,7 +2110,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { account_id=account_idExample.value), body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id=bank_idExample.value, account_id=account_idExample.value)), - to_sepa=Some(TransactionRequestIban("string")), + to_sepa=Some(TransactionRequestIban(transactionRequestIban.value)), to_counterparty=Some(TransactionRequestCounterpartyId(transactionRequestCounterpartyIdExample.value)), to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, amount=amountExample.value), @@ -2150,8 +2150,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { description="string"), transaction_ids="string", status="string", - start_date=parseDate(transactionRequestStartDateExample.value).getOrElse(sys.error("transactionRequestStartDateExample.value is not valid date format.")), - end_date=parseDate(transactionRequestEndDateExample.value).getOrElse(sys.error("transactionRequestEndDateExample.value is not valid date format.")), + start_date=toDate(transactionRequestStartDateExample), + end_date=toDate(transactionRequestEndDateExample), challenge= TransactionRequestChallenge(id="string", allowed_attempts=123, challenge_type="string"), @@ -2180,7 +2180,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { account_id=account_idExample.value), body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id=bank_idExample.value, account_id=account_idExample.value)), - to_sepa=Some(TransactionRequestIban("string")), + to_sepa=Some(TransactionRequestIban(transactionRequestIban.value)), to_counterparty=Some(TransactionRequestCounterpartyId(transactionRequestCounterpartyIdExample.value)), to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, amount=amountExample.value), @@ -2220,8 +2220,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { description="string"), transaction_ids="string", status="string", - start_date=parseDate(transactionRequestStartDateExample.value).getOrElse(sys.error("transactionRequestStartDateExample.value is not valid date format.")), - end_date=parseDate(transactionRequestEndDateExample.value).getOrElse(sys.error("transactionRequestEndDateExample.value is not valid date format.")), + start_date=toDate(transactionRequestStartDateExample), + end_date=toDate(transactionRequestEndDateExample), challenge= TransactionRequestChallenge(id="string", allowed_attempts=123, challenge_type="string"), @@ -2280,7 +2280,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -2332,7 +2332,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -2406,7 +2406,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { countryCode="string"), location= Location(latitude=123.123, longitude=123.123, - date=Some(parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format."))), + date=Some(toDate(dateExample)), user=Some( BasicResourceUser(userId=userIdExample.value, provider="string", username=usernameExample.value))), @@ -2492,7 +2492,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { countryCode="string"), location= Location(latitude=123.123, longitude=123.123, - date=Some(parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format."))), + date=Some(toDate(dateExample)), user=Some( BasicResourceUser(userId=userIdExample.value, provider="string", username=usernameExample.value))), @@ -2575,7 +2575,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { countryCode="string"), location= Location(latitude=123.123, longitude=123.123, - date=Some(parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format."))), + date=Some(toDate(dateExample)), user=Some( BasicResourceUser(userId=userIdExample.value, provider="string", username=usernameExample.value))), @@ -2641,7 +2641,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { countryCode="string"), location= Location(latitude=123.123, longitude=123.123, - date=Some(parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format."))), + date=Some(toDate(dateExample)), user=Some( BasicResourceUser(userId=userIdExample.value, provider="string", username=usernameExample.value))), @@ -2700,7 +2700,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -2721,7 +2721,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { account_id=account_idExample.value), body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id=bank_idExample.value, account_id=account_idExample.value)), - to_sepa=Some(TransactionRequestIban("string")), + to_sepa=Some(TransactionRequestIban(transactionRequestIban.value)), to_counterparty=Some(TransactionRequestCounterpartyId(transactionRequestCounterpartyIdExample.value)), to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, amount=amountExample.value), @@ -2761,8 +2761,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { description="string"), transaction_ids="string", status="string", - start_date=parseDate(transactionRequestStartDateExample.value).getOrElse(sys.error("transactionRequestStartDateExample.value is not valid date format.")), - end_date=parseDate(transactionRequestEndDateExample.value).getOrElse(sys.error("transactionRequestEndDateExample.value is not valid date format.")), + start_date=toDate(transactionRequestStartDateExample), + end_date=toDate(transactionRequestEndDateExample), challenge= TransactionRequestChallenge(id="string", allowed_attempts=123, challenge_type="string"), @@ -2816,7 +2816,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -2834,7 +2834,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -2907,7 +2907,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -2925,7 +2925,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -2968,7 +2968,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { account_id=account_idExample.value), body= TransactionRequestBodyAllTypes(to_sandbox_tan=Some( TransactionRequestAccount(bank_id=bank_idExample.value, account_id=account_idExample.value)), - to_sepa=Some(TransactionRequestIban("string")), + to_sepa=Some(TransactionRequestIban(transactionRequestIban.value)), to_counterparty=Some(TransactionRequestCounterpartyId(transactionRequestCounterpartyIdExample.value)), to_transfer_to_phone=Some( TransactionRequestTransferToPhone(value= AmountOfMoneyJsonV121(currency=currencyExample.value, amount=amountExample.value), @@ -3008,8 +3008,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { description="string"), transaction_ids="string", status="string", - start_date=parseDate(transactionRequestStartDateExample.value).getOrElse(sys.error("transactionRequestStartDateExample.value is not valid date format.")), - end_date=parseDate(transactionRequestEndDateExample.value).getOrElse(sys.error("transactionRequestEndDateExample.value is not valid date format.")), + start_date=toDate(transactionRequestStartDateExample), + end_date=toDate(transactionRequestEndDateExample), challenge= TransactionRequestChallenge(id="string", allowed_attempts=123, challenge_type="string"), @@ -3138,16 +3138,16 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, highestEducationAttained=highestEducationAttainedExample.value, employmentStatus=employmentStatusExample.value, kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(outBoundCreateCustomerLastOkDateExample.value).getOrElse(sys.error("outBoundCreateCustomerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(outBoundCreateCustomerLastOkDateExample), creditRating=Some( CreditRating(rating=ratingExample.value, source=sourceExample.value)), creditLimit=Some( AmountOfMoney(currency=currencyExample.value, @@ -3165,9 +3165,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, @@ -3178,7 +3178,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { creditLimit= CreditLimit(currency=currencyExample.value, amount=creditLimitAmountExample.value), kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(customerLastOkDateExample), title=customerTitleExample.value, branchId=branchIdExample.value, nameSuffix=nameSuffixExample.value)) @@ -3216,9 +3216,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, @@ -3229,7 +3229,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { creditLimit= CreditLimit(currency=currencyExample.value, amount=creditLimitAmountExample.value), kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(customerLastOkDateExample), title=customerTitleExample.value, branchId=branchIdExample.value, nameSuffix=nameSuffixExample.value)) @@ -3268,9 +3268,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, @@ -3281,7 +3281,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { creditLimit= CreditLimit(currency=currencyExample.value, amount=creditLimitAmountExample.value), kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(customerLastOkDateExample), title=customerTitleExample.value, branchId=branchIdExample.value, nameSuffix=nameSuffixExample.value)) @@ -3307,9 +3307,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { OutBoundUpdateCustomerGeneralData(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext, customerId=customerIdExample.value, legalName=Some(legalNameExample.value), - faceImage=Some( CustomerFaceImage(date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + faceImage=Some( CustomerFaceImage(date=toDate(dateExample), url=urlExample.value)), - dateOfBirth=Some(parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format."))), + dateOfBirth=Some(toDate(dateOfBirthExample)), relationshipStatus=Some(relationshipStatusExample.value), dependents=Some(dependentsExample.value.toInt), highestEducationAttained=Some(highestEducationAttainedExample.value), @@ -3327,9 +3327,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, @@ -3340,7 +3340,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { creditLimit= CreditLimit(currency=currencyExample.value, amount=creditLimitAmountExample.value), kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(customerLastOkDateExample), title=customerTitleExample.value, branchId=branchIdExample.value, nameSuffix=nameSuffixExample.value)) @@ -3375,9 +3375,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, @@ -3388,7 +3388,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { creditLimit= CreditLimit(currency=currencyExample.value, amount=creditLimitAmountExample.value), kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(customerLastOkDateExample), title=customerTitleExample.value, branchId=branchIdExample.value, nameSuffix=nameSuffixExample.value))) @@ -3423,9 +3423,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, @@ -3436,7 +3436,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { creditLimit= CreditLimit(currency=currencyExample.value, amount=creditLimitAmountExample.value), kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(customerLastOkDateExample), title=customerTitleExample.value, branchId=branchIdExample.value, nameSuffix=nameSuffixExample.value)) @@ -3472,9 +3472,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, @@ -3485,7 +3485,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { creditLimit= CreditLimit(currency=currencyExample.value, amount=creditLimitAmountExample.value), kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(customerLastOkDateExample), title=customerTitleExample.value, branchId=branchIdExample.value, nameSuffix=nameSuffixExample.value)) @@ -3526,7 +3526,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { countryCode="string", status="string", tags="string", - insertDate=parseDate(insertDateExample.value).getOrElse(sys.error("insertDateExample.value is not valid date format."))))) + insertDate=toDate(insertDateExample)))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) @@ -3574,7 +3574,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { countryCode="string", status="string", tags="string", - insertDate=parseDate(insertDateExample.value).getOrElse(sys.error("insertDateExample.value is not valid date format.")))) + insertDate=toDate(insertDateExample))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) @@ -3622,7 +3622,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { countryCode="string", status="string", tags="string", - insertDate=parseDate(insertDateExample.value).getOrElse(sys.error("insertDateExample.value is not valid date format.")))) + insertDate=toDate(insertDateExample))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) @@ -3770,9 +3770,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, @@ -3783,7 +3783,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { creditLimit= CreditLimit(currency=currencyExample.value, amount=creditLimitAmountExample.value), kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(customerLastOkDateExample), title=customerTitleExample.value, branchId=branchIdExample.value, nameSuffix=nameSuffixExample.value))) @@ -3819,9 +3819,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, @@ -3832,7 +3832,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { creditLimit= CreditLimit(currency=currencyExample.value, amount=creditLimitAmountExample.value), kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(customerLastOkDateExample), title=customerTitleExample.value, branchId=branchIdExample.value, nameSuffix=nameSuffixExample.value))) @@ -4506,9 +4506,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { legalName=legalNameExample.value, mobileNumber=mobileNumberExample.value, email=emailExample.value, - faceImage= CustomerFaceImage(date=parseDate(customerFaceImageDateExample.value).getOrElse(sys.error("customerFaceImageDateExample.value is not valid date format.")), + faceImage= CustomerFaceImage(date=toDate(customerFaceImageDateExample), url=urlExample.value), - dateOfBirth=parseDate(dateOfBirthExample.value).getOrElse(sys.error("dateOfBirthExample.value is not valid date format.")), + dateOfBirth=toDate(dateOfBirthExample), relationshipStatus=relationshipStatusExample.value, dependents=dependentsExample.value.toInt, dobOfDependents=dobOfDependentsExample.value.split("[,;]").map(parseDate).flatMap(_.toSeq).toList, @@ -4519,7 +4519,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { creditLimit= CreditLimit(currency=currencyExample.value, amount=creditLimitAmountExample.value), kycStatus=kycStatusExample.value.toBoolean, - lastOkDate=parseDate(customerLastOkDateExample.value).getOrElse(sys.error("customerLastOkDateExample.value is not valid date format.")), + lastOkDate=toDate(customerLastOkDateExample), title=customerTitleExample.value, branchId=branchIdExample.value, nameSuffix=nameSuffixExample.value))) @@ -4527,7 +4527,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { exampleInboundMessage = ( InBoundGetCustomerAttributesForCustomers(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, - data = List( + data= List( CustomerAndAttribute( MessageDocsSwaggerDefinitions.customerCommons, List(MessageDocsSwaggerDefinitions.customerAttribute) @@ -4542,7 +4542,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { import com.openbankproject.commons.dto.{OutBoundGetCustomerAttributesForCustomers => OutBound, InBoundGetCustomerAttributesForCustomers => InBound} val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, customers) val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_customer_attributes_for_customers", req, callContext) - response.map(convertToTuple[List[CustomerAndAttribute]](callContext)) + response.map(convertToTuple[List[CustomerAndAttribute]](callContext)) } messageDocs += getTransactionIdsByAttributeNameValuesDoc @@ -4753,7 +4753,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { productCode=ProductCode("string"), userId=userIdExample.value, customerId=customerIdExample.value, - dateOfApplication=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + dateOfApplication=toDate(dateExample), status="string")) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -4783,7 +4783,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { productCode=ProductCode("string"), userId=userIdExample.value, customerId=customerIdExample.value, - dateOfApplication=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + dateOfApplication=toDate(dateExample), status="string"))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -4814,7 +4814,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { productCode=ProductCode("string"), userId=userIdExample.value, customerId=customerIdExample.value, - dateOfApplication=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + dateOfApplication=toDate(dateExample), status="string")) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -4846,7 +4846,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { productCode=ProductCode("string"), userId=userIdExample.value, customerId=customerIdExample.value, - dateOfApplication=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + dateOfApplication=toDate(dateExample), status="string")) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -5039,7 +5039,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { name=userNameExample.value), providerId="string", purposeId="string", - when=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + when=toDate(dateExample), sessionId=sessionIdExample.value, customerToken="string", staffToken="string", @@ -5063,7 +5063,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { keys= MeetingKeys(sessionId=sessionIdExample.value, customerToken="string", staffToken="string"), - when=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + when=toDate(dateExample), creator= ContactDetails(name="string", phone="string", email=emailExample.value), @@ -5111,7 +5111,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { keys= MeetingKeys(sessionId=sessionIdExample.value, customerToken="string", staffToken="string"), - when=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + when=toDate(dateExample), creator= ContactDetails(name="string", phone="string", email=emailExample.value), @@ -5160,7 +5160,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { keys= MeetingKeys(sessionId=sessionIdExample.value, customerToken="string", staffToken="string"), - when=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + when=toDate(dateExample), creator= ContactDetails(name="string", phone="string", email=emailExample.value), @@ -5192,7 +5192,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value, id="string", customerNumber=customerNumberExample.value, - date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + date=toDate(dateExample), how="string", staffUserId="string", mStaffName="string", @@ -5206,7 +5206,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value, idKycCheck="string", customerNumber=customerNumberExample.value, - date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + date=toDate(dateExample), how="string", staffUserId="string", staffName="string", @@ -5238,9 +5238,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerNumber=customerNumberExample.value, `type`="string", number="string", - issueDate=parseDate(issueDateExample.value).getOrElse(sys.error("issueDateExample.value is not valid date format.")), + issueDate=toDate(issueDateExample), issuePlace="string", - expiryDate=parseDate(expiryDateExample.value).getOrElse(sys.error("expiryDateExample.value is not valid date format."))) + expiryDate=toDate(expiryDateExample)) ), exampleInboundMessage = ( InBoundCreateOrUpdateKycDocument(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, @@ -5251,9 +5251,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerNumber=customerNumberExample.value, `type`="string", number="string", - issueDate=parseDate(issueDateExample.value).getOrElse(sys.error("issueDateExample.value is not valid date format.")), + issueDate=toDate(issueDateExample), issuePlace="string", - expiryDate=parseDate(expiryDateExample.value).getOrElse(sys.error("expiryDateExample.value is not valid date format.")))) + expiryDate=toDate(expiryDateExample))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) @@ -5280,7 +5280,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerNumber=customerNumberExample.value, `type`="string", url=urlExample.value, - date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + date=toDate(dateExample), relatesToKycDocumentId="string", relatesToKycCheckId="string") ), @@ -5293,7 +5293,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerNumber=customerNumberExample.value, `type`="string", url=urlExample.value, - date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + date=toDate(dateExample), relatesToKycDocumentId="string", relatesToKycCheckId="string")) ), @@ -5320,7 +5320,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value, customerNumber=customerNumberExample.value, ok=true, - date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format."))) + date=toDate(dateExample)) ), exampleInboundMessage = ( InBoundCreateOrUpdateKycStatus(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, @@ -5329,7 +5329,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value, customerNumber=customerNumberExample.value, ok=true, - date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")))) + date=toDate(dateExample))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) @@ -5359,7 +5359,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value, idKycCheck="string", customerNumber=customerNumberExample.value, - date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + date=toDate(dateExample), how="string", staffUserId="string", staffName="string", @@ -5396,9 +5396,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerNumber=customerNumberExample.value, `type`="string", number="string", - issueDate=parseDate(issueDateExample.value).getOrElse(sys.error("issueDateExample.value is not valid date format.")), + issueDate=toDate(issueDateExample), issuePlace="string", - expiryDate=parseDate(expiryDateExample.value).getOrElse(sys.error("expiryDateExample.value is not valid date format."))))) + expiryDate=toDate(expiryDateExample)))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) @@ -5430,7 +5430,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerNumber=customerNumberExample.value, `type`="string", url=urlExample.value, - date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + date=toDate(dateExample), relatesToKycDocumentId="string", relatesToKycCheckId="string"))) ), @@ -5462,7 +5462,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value, customerNumber=customerNumberExample.value, ok=true, - date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format."))))) + date=toDate(dateExample)))) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) ) @@ -5498,7 +5498,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { InBoundCreateMessage(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, status=MessageDocsSwaggerDefinitions.inboundStatus, data= CustomerMessageCommons(messageId="string", - date=parseDate(dateExample.value).getOrElse(sys.error("dateExample.value is not valid date format.")), + date=toDate(dateExample), message="string", fromDepartment="string", fromPerson="string")) @@ -5531,7 +5531,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -5549,7 +5549,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { iban=Some(ibanExample.value), number=bankAccountNumberExample.value, bankId=BankId(bankIdExample.value), - lastUpdate=parseDate(bankAccountLastUpdateExample.value).getOrElse(sys.error("bankAccountLastUpdateExample.value is not valid date format.")), + lastUpdate=toDate(bankAccountLastUpdateExample), branchId=branchIdExample.value, accountRoutingScheme=accountRoutingSchemeExample.value, accountRoutingAddress=accountRoutingAddressExample.value, @@ -5558,8 +5558,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { accountRules=List( AccountRule(scheme=accountRuleSchemeExample.value, value=accountRuleValueExample.value)), accountHolder=bankAccountAccountHolderExample.value), - posted=parseDate(postedDateExample.value).getOrElse(sys.error("postedDateExample.value is not valid date format.")), - completed=parseDate(completedDateExample.value).getOrElse(sys.error("completedDateExample.value is not valid date format.")), + posted=toDate(postedDateExample), + completed=toDate(completedDateExample), amount=BigDecimal(amountExample.value), description="string", transactionRequestType=transactionRequestTypeExample.value, @@ -5594,9 +5594,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value, userId=userIdExample.value, counterpartyId=counterpartyIdExample.value, - dateSigned=parseDate(dateSignedExample.value).getOrElse(sys.error("dateSignedExample.value is not valid date format.")), - dateStarts=parseDate(dateStartsExample.value).getOrElse(sys.error("dateStartsExample.value is not valid date format.")), - dateExpires=Some(parseDate(dateExpiresExample.value).getOrElse(sys.error("dateExpiresExample.value is not valid date format.")))) + dateSigned=toDate(dateSignedExample), + dateStarts=toDate(dateStartsExample), + dateExpires=Some(toDate(dateExpiresExample))) ), exampleInboundMessage = ( InBoundCreateDirectDebit(inboundAdapterCallContext=MessageDocsSwaggerDefinitions.inboundAdapterCallContext, @@ -5607,10 +5607,10 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { customerId=customerIdExample.value, userId=userIdExample.value, counterpartyId=counterpartyIdExample.value, - dateSigned=parseDate(dateSignedExample.value).getOrElse(sys.error("dateSignedExample.value is not valid date format.")), - dateCancelled=parseDate(dateCancelledExample.value).getOrElse(sys.error("dateCancelledExample.value is not valid date format.")), - dateStarts=parseDate(dateStartsExample.value).getOrElse(sys.error("dateStartsExample.value is not valid date format.")), - dateExpires=parseDate(dateExpiresExample.value).getOrElse(sys.error("dateExpiresExample.value is not valid date format.")), + dateSigned=toDate(dateSignedExample), + dateCancelled=toDate(dateCancelledExample), + dateStarts=toDate(dateStartsExample), + dateExpires=toDate(dateExpiresExample), active=true)) ), adapterImplementation = Some(AdapterImplementation("- Core", 1)) @@ -5649,8 +5649,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable { response.map(convertToTuple[Boolean](callContext)) } -// ---------- created on 2020-07-02T16:06:15Z -//---------------- dynamic end ---------------------please don't modify this line +// ---------- created on 2020-07-14T16:11:11Z +//---------------- dynamic end ---------------------please don't modify this line private val availableOperation = DynamicEntityOperation.values.map(it => s""""$it"""").mkString("[", ", ", "]") From ea97e1d5a145d32bd24a3238bf53b825e7257f54 Mon Sep 17 00:00:00 2001 From: shuang Date: Tue, 14 Jul 2020 16:27:17 +0800 Subject: [PATCH 3/3] feature/ignore_Inbound_field_value_for_unit_test: bump up pom version from 1.5.7 to 1.6.0 --- obp-api/pom.xml | 2 +- obp-commons/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/obp-api/pom.xml b/obp-api/pom.xml index 127648da7..8502b017c 100644 --- a/obp-api/pom.xml +++ b/obp-api/pom.xml @@ -8,7 +8,7 @@ com.tesobe obp-parent ../pom.xml - 1.5.8 + 1.6.0 obp-api war diff --git a/obp-commons/pom.xml b/obp-commons/pom.xml index 2954d93ba..9290e0abb 100644 --- a/obp-commons/pom.xml +++ b/obp-commons/pom.xml @@ -7,7 +7,7 @@ com.tesobe obp-parent ../pom.xml - 1.5.8 + 1.6.0 obp-commons jar diff --git a/pom.xml b/pom.xml index c894a2592..649065e97 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.tesobe obp-parent - 1.5.8 + 1.6.0 pom Open Bank Project API Parent 2011