diff --git a/accounts-demo/build.gradle.kts b/accounts-demo/build.gradle.kts index 21be8d16..dd0f9c0f 100644 --- a/accounts-demo/build.gradle.kts +++ b/accounts-demo/build.gradle.kts @@ -72,7 +72,6 @@ android { dependencies { implementation(projects.appCommon) implementation(projects.accountsJourney) - implementation(projects.accountsUseCase) implementation(platform(backbase.bom)) diff --git a/accounts-demo/src/main/kotlin/com/backbase/accounts_demo/journey/accounts/AccountsModule.kt b/accounts-demo/src/main/kotlin/com/backbase/accounts_demo/journey/accounts/AccountsModule.kt index 20e10c0e..a17094bd 100644 --- a/accounts-demo/src/main/kotlin/com/backbase/accounts_demo/journey/accounts/AccountsModule.kt +++ b/accounts-demo/src/main/kotlin/com/backbase/accounts_demo/journey/accounts/AccountsModule.kt @@ -3,8 +3,8 @@ package com.backbase.accounts_demo.journey.accounts import android.app.Application import com.backbase.accounts_journey.AccountsJourney import com.backbase.accounts_journey.routing.AccountsRoutingImpl -import com.backbase.accounts_use_case.AccountDetailUseCaseImpl -import com.backbase.accounts_use_case.AccountSummaryUseCaseImpl +import com.backbase.accounts_journey.data.usecase.AccountDetailUseCaseImpl +import com.backbase.accounts_journey.data.usecase.AccountSummaryUseCaseImpl import com.backbase.android.client.gen2.arrangementclient2.api.ArrangementsApi import com.backbase.android.client.gen2.arrangementclient2.api.ProductSummaryApi import com.backbase.app_common.accounts.accountsModule diff --git a/accounts-journey/build.gradle.kts b/accounts-journey/build.gradle.kts index c3bb8672..a9a9d456 100644 --- a/accounts-journey/build.gradle.kts +++ b/accounts-journey/build.gradle.kts @@ -39,6 +39,7 @@ dependencies { implementation(platform(backbase.bom)) implementation(midTier.bundles.common) implementation(libs.bundles.navigation) + implementation(clients.arrangements) coreLibraryDesugaring(libs.coreLibraryDesugaring) diff --git a/accounts-journey/src/androidTest/java/testCases/AccountsListTests.kt b/accounts-journey/src/androidTest/java/testCases/AccountsListTests.kt index 939412d9..0027b445 100644 --- a/accounts-journey/src/androidTest/java/testCases/AccountsListTests.kt +++ b/accounts-journey/src/androidTest/java/testCases/AccountsListTests.kt @@ -15,10 +15,12 @@ import com.backbase.accounts_journey.generator.AccountSummaryGenerator import com.backbase.accounts_journey.presentation.accountlist.ui.AccountListFragment import com.backbase.accounts_use_case.ErrorAccountsUseCase import com.backbase.accounts_use_case.SuccessAccountsUseCase +import com.backbase.android.test_data.NumberGenerator.randomFloat import com.backbase.android.test_data.shouldBeDisplayed import kotlinx.coroutines.ExperimentalCoroutinesApi import org.junit.Test import screens.accountListScreen +import java.math.BigDecimal @OptIn(ExperimentalCoroutinesApi::class) class AccountsListTests : BaseTest() { @@ -33,7 +35,7 @@ class AccountsListTests : BaseTest() { accountWithName(ACCOUNT_NAME) { accountNameIsDisplayed() - accountBalanceIsDisplayed(ACCOUNT_BALANCE) + accountBalanceIsDisplayed(ACCOUNT_BALANCE.toString()) } } } @@ -124,7 +126,7 @@ class AccountsListTests : BaseTest() { companion object { const val ACCOUNT_NAME = "Alpha" - const val ACCOUNT_BALANCE = "45.89" + val ACCOUNT_BALANCE = BigDecimal.valueOf(45.89) val TEST_ACCOUNTS = AccountSummaryGenerator.generateAccountSummary( displayName = ACCOUNT_NAME, availableBalance = ACCOUNT_BALANCE diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountDetailUseCase.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountDetailUseCase.kt index 891d659e..5e4b4a25 100644 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountDetailUseCase.kt +++ b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountDetailUseCase.kt @@ -1,10 +1,10 @@ package com.backbase.accounts_journey.data.usecase -import com.backbase.accounts_journey.domain.model.account_detail.AccountDetail +import com.backbase.android.client.gen2.arrangementclient2.model.AccountArrangementItem import dev.drewhamilton.poko.Poko interface AccountDetailUseCase { - suspend fun getAccountDetail(params: Params): Result + suspend fun getAccountDetail(params: Params): Result @Poko class Params private constructor(val id: String) { diff --git a/accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/AccountDetailUseCaseImpl.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountDetailUseCaseImpl.kt similarity index 80% rename from accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/AccountDetailUseCaseImpl.kt rename to accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountDetailUseCaseImpl.kt index 32b73f9e..21a444ab 100644 --- a/accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/AccountDetailUseCaseImpl.kt +++ b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountDetailUseCaseImpl.kt @@ -1,13 +1,11 @@ -package com.backbase.accounts_use_case +package com.backbase.accounts_journey.data.usecase import com.backbase.accounts_journey.common.FailedGetDataException import com.backbase.accounts_journey.common.NoInternetException import com.backbase.accounts_journey.common.NoResponseException -import com.backbase.accounts_journey.data.usecase.AccountDetailUseCase -import com.backbase.accounts_journey.domain.model.account_detail.AccountDetail -import com.backbase.accounts_use_case.mapper.mapToDomain import com.backbase.android.client.gen2.arrangementclient2.api.ArrangementsApi import com.backbase.android.client.gen2.arrangementclient2.api.ArrangementsApiParams +import com.backbase.android.client.gen2.arrangementclient2.model.AccountArrangementItem import com.backbase.android.clients.common.CallResult import com.backbase.android.core.errorhandling.ErrorCodes import kotlinx.coroutines.CoroutineDispatcher @@ -24,7 +22,7 @@ class AccountDetailUseCaseImpl( private val dispatcher: CoroutineDispatcher = Dispatchers.IO ) : AccountDetailUseCase { - override suspend fun getAccountDetail(params: AccountDetailUseCase.Params): Result { + override suspend fun getAccountDetail(params: AccountDetailUseCase.Params): Result { val callResult = withContext(dispatcher) { arrangementsApi.getArrangementById( ArrangementsApiParams.GetArrangementById { @@ -35,9 +33,7 @@ class AccountDetailUseCaseImpl( return when (callResult) { is CallResult.Success -> { - val dataModel = callResult.data - val domainModel = dataModel.mapToDomain() - Result.success(domainModel) + Result.success(callResult.data) } is CallResult.Error -> { diff --git a/accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/AccountSummaryUseCaseImpl.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountSummaryUseCaseImpl.kt similarity index 78% rename from accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/AccountSummaryUseCaseImpl.kt rename to accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountSummaryUseCaseImpl.kt index 0b019fa3..713a62ee 100644 --- a/accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/AccountSummaryUseCaseImpl.kt +++ b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountSummaryUseCaseImpl.kt @@ -1,13 +1,11 @@ -package com.backbase.accounts_use_case +package com.backbase.accounts_journey.data.usecase import com.backbase.accounts_journey.common.FailedGetDataException import com.backbase.accounts_journey.common.NoInternetException import com.backbase.accounts_journey.common.NoResponseException -import com.backbase.accounts_journey.data.usecase.AccountsUseCase -import com.backbase.accounts_journey.domain.model.account_summary.AccountSummary -import com.backbase.accounts_use_case.mapper.mapToDomain import com.backbase.android.client.gen2.arrangementclient2.api.ProductSummaryApi import com.backbase.android.client.gen2.arrangementclient2.api.ProductSummaryApiParams +import com.backbase.android.client.gen2.arrangementclient2.model.ProductSummary import com.backbase.android.clients.common.CallResult import com.backbase.android.core.errorhandling.ErrorCodes import kotlinx.coroutines.CoroutineDispatcher @@ -24,9 +22,9 @@ class AccountSummaryUseCaseImpl( private val ioDispatcher: CoroutineDispatcher = Dispatchers.IO, ) : AccountsUseCase { - private var cache: AccountSummary? = null + private var cache: ProductSummary? = null - override suspend fun getAccountSummary(useCache: Boolean): Result { + override suspend fun getAccountSummary(useCache: Boolean): Result { if (useCache && cache != null) { return Result.success(cache!!) } @@ -39,10 +37,9 @@ class AccountSummaryUseCaseImpl( return when (callResult) { is CallResult.Success -> { - val dataModel = callResult.data - val domainModel = dataModel.mapToDomain() - cache = domainModel - Result.success(domainModel) + val data = callResult.data + cache = data + Result.success(data) } is CallResult.Error -> { diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountsUseCase.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountsUseCase.kt index fc05d1c4..062c2ca8 100644 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountsUseCase.kt +++ b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/data/usecase/AccountsUseCase.kt @@ -1,6 +1,6 @@ package com.backbase.accounts_journey.data.usecase -import com.backbase.accounts_journey.domain.model.account_summary.AccountSummary +import com.backbase.android.client.gen2.arrangementclient2.model.ProductSummary /** * The use cases for the accounts/products. @@ -12,7 +12,7 @@ interface AccountsUseCase { /** * Method that fetches a list of accounts. * - * @return an instance of [AccountSummary] + * @return an instance of [ProductSummary] */ - suspend fun getAccountSummary(useCache: Boolean = true): Result + suspend fun getAccountSummary(useCache: Boolean = true): Result } diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/AccountDetail.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/AccountDetail.kt deleted file mode 100644 index 9c6e933a..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/AccountDetail.kt +++ /dev/null @@ -1,625 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_detail - -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.common.CardDetails -import com.backbase.accounts_journey.domain.model.common.DebitCardItem -import com.backbase.accounts_journey.domain.model.common.InterestDetails -import com.backbase.accounts_journey.domain.model.common.ProductState -import com.backbase.accounts_journey.domain.model.common.TimeUnit -import dev.drewhamilton.poko.Poko -import java.math.BigDecimal -import java.time.LocalDate -import java.time.OffsetDateTime - -@Suppress("LongParameterList") -@Poko -class AccountDetail private constructor( - val id: String, - val productId: String, - val productKindName: String?, - val legalEntityIds: Set?, - val productTypeName: String?, - val externalProductId: String?, - val externalArrangementId: String?, - val userPreferences: AccountUserPreferences?, - val product: ExternalProductItem?, - val state: ProductState?, - val parentId: String?, - val currency: String, - val name: String?, - val bookedBalance: BigDecimal?, - val availableBalance: BigDecimal?, - val creditLimit: BigDecimal?, - @Suppress("ConstructorParameterNaming") val IBAN: String?, - @Suppress("ConstructorParameterNaming") val BBAN: String?, - @Suppress("ConstructorParameterNaming") val BIC: String?, - val externalTransferAllowed: Boolean?, - val urgentTransferAllowed: Boolean?, - val accruedInterest: BigDecimal?, - val number: String?, - val principalAmount: BigDecimal?, - val currentInvestmentValue: BigDecimal?, - val productNumber: String?, - val bankBranchCode: String?, - val bankBranchCode2: String?, - val accountOpeningDate: OffsetDateTime?, - val accountInterestRate: BigDecimal?, - val valueDateBalance: BigDecimal?, - val creditLimitUsage: BigDecimal?, - val creditLimitInterestRate: BigDecimal?, - val creditLimitExpiryDate: OffsetDateTime?, - val startDate: OffsetDateTime?, - val termUnit: TimeUnit?, - val termNumber: BigDecimal?, - val interestPaymentFrequencyUnit: TimeUnit?, - val interestPaymentFrequencyNumber: BigDecimal?, - val maturityDate: OffsetDateTime?, - val maturityAmount: BigDecimal?, - val autoRenewalIndicator: Boolean?, - val interestSettlementAccount: String?, - val outstandingPrincipalAmount: BigDecimal?, - val monthlyInstalmentAmount: BigDecimal?, - val amountInArrear: BigDecimal?, - val minimumRequiredBalance: BigDecimal?, - val creditCardAccountNumber: String?, - val validThru: OffsetDateTime?, - val applicableInterestRate: BigDecimal?, - val remainingCredit: BigDecimal?, - val outstandingPayment: BigDecimal?, - val minimumPayment: BigDecimal?, - val minimumPaymentDueDate: OffsetDateTime?, - val totalInvestmentValue: BigDecimal?, - val debitCards: Set?, - val accountHolderAddressLine1: String?, - val accountHolderAddressLine2: String?, - val accountHolderStreetName: String?, - val town: String?, - val postCode: String?, - val countrySubDivision: String?, - val accountHolderNames: String?, - val accountHolderCountry: String?, - val creditAccount: Boolean?, - val debitAccount: Boolean?, - val lastUpdateDate: OffsetDateTime?, - val bankAlias: String?, - val sourceId: String?, - val externalStateId: String?, - val externalParentId: String?, - - val financialInstitutionId: Long?, - val lastSyncDate: OffsetDateTime?, - val additions: Map?, - val unmaskableAttributes: Set?, - val displayName: String?, - val cardDetails: CardDetails?, - val interestDetails: InterestDetails?, - val reservedAmount: BigDecimal?, - val remainingPeriodicTransfers: BigDecimal?, - val nextClosingDate: LocalDate?, - val overdueSince: LocalDate?, - val externalAccountStatus: String?, -) { - /** - * A Builder for [AccountArrangementItem] - */ - class Builder { - - /** - * See [AccountArrangementItem.id]. - */ - lateinit var id: String - - /** - * See [AccountArrangementItem.productId]. - */ - lateinit var productId: String - - /** - * See [AccountArrangementItem.productKindName]. - */ - var productKindName: String? = null - - /** - * See [AccountArrangementItem.legalEntityIds]. - */ - var legalEntityIds: Set? = null - - /** - * See [AccountArrangementItem.productTypeName]. - */ - var productTypeName: String? = null - - /** - * See [AccountArrangementItem.externalProductId]. - */ - var externalProductId: String? = null - - /** - * See [AccountArrangementItem.externalArrangementId]. - */ - var externalArrangementId: String? = null - - /** - * See [AccountArrangementItem.userPreferences]. - */ - var userPreferences: AccountUserPreferences? = null - - /** - * See [AccountArrangementItem.product]. - */ - var product: ExternalProductItem? = null - - /** - * See [AccountArrangementItem.state]. - */ - var state: ProductState? = null - - /** - * See [AccountArrangementItem.parentId]. - */ - var parentId: String? = null - - /** - * See [AccountArrangementItem.currency]. - */ - lateinit var currency: String - - /** - * See [AccountArrangementItem.name]. - */ - var name: String? = null - - /** - * See [AccountArrangementItem.bookedBalance]. - */ - var bookedBalance: BigDecimal? = null - - /** - * See [AccountArrangementItem.availableBalance]. - */ - var availableBalance: BigDecimal? = null - - /** - * See [AccountArrangementItem.creditLimit]. - */ - var creditLimit: BigDecimal? = null - - /** - * See [AccountArrangementItem.IBAN]. - */ - @Suppress("VariableNaming") - var IBAN: String? = null - - /** - * See [AccountArrangementItem.BBAN]. - */ - @Suppress("VariableNaming") - var BBAN: String? = null - - /** - * See [AccountArrangementItem.BIC]. - */ - @Suppress("VariableNaming") - var BIC: String? = null - - /** - * See [AccountArrangementItem.externalTransferAllowed]. - */ - var externalTransferAllowed: Boolean? = null - - /** - * See [AccountArrangementItem.urgentTransferAllowed]. - */ - var urgentTransferAllowed: Boolean? = null - - /** - * See [AccountArrangementItem.accruedInterest]. - */ - var accruedInterest: BigDecimal? = null - - /** - * See [AccountArrangementItem.number]. - */ - var number: String? = null - - /** - * See [AccountArrangementItem.principalAmount]. - */ - var principalAmount: BigDecimal? = null - - /** - * See [AccountArrangementItem.currentInvestmentValue]. - */ - var currentInvestmentValue: BigDecimal? = null - - /** - * See [AccountArrangementItem.productNumber]. - */ - var productNumber: String? = null - - /** - * See [AccountArrangementItem.bankBranchCode]. - */ - var bankBranchCode: String? = null - - /** - * See [AccountArrangementItem.bankBranchCode2]. - */ - var bankBranchCode2: String? = null - - /** - * See [AccountArrangementItem.accountOpeningDate]. - */ - var accountOpeningDate: OffsetDateTime? = null - - /** - * See [AccountArrangementItem.accountInterestRate]. - */ - var accountInterestRate: BigDecimal? = null - - /** - * See [AccountArrangementItem.valueDateBalance]. - */ - var valueDateBalance: BigDecimal? = null - - /** - * See [AccountArrangementItem.creditLimitUsage]. - */ - var creditLimitUsage: BigDecimal? = null - - /** - * See [AccountArrangementItem.creditLimitInterestRate]. - */ - var creditLimitInterestRate: BigDecimal? = null - - /** - * See [AccountArrangementItem.creditLimitExpiryDate]. - */ - var creditLimitExpiryDate: OffsetDateTime? = null - - /** - * See [AccountArrangementItem.startDate]. - */ - var startDate: OffsetDateTime? = null - - /** - * See [AccountArrangementItem.termUnit]. - */ - var termUnit: TimeUnit? = null - - /** - * See [AccountArrangementItem.termNumber]. - */ - var termNumber: BigDecimal? = null - - /** - * See [AccountArrangementItem.interestPaymentFrequencyUnit]. - */ - var interestPaymentFrequencyUnit: TimeUnit? = null - - /** - * See [AccountArrangementItem.interestPaymentFrequencyNumber]. - */ - var interestPaymentFrequencyNumber: BigDecimal? = null - - /** - * See [AccountArrangementItem.maturityDate]. - */ - var maturityDate: OffsetDateTime? = null - - /** - * See [AccountArrangementItem.maturityAmount]. - */ - var maturityAmount: BigDecimal? = null - - /** - * See [AccountArrangementItem.autoRenewalIndicator]. - */ - var autoRenewalIndicator: Boolean? = null - - /** - * See [AccountArrangementItem.interestSettlementAccount]. - */ - var interestSettlementAccount: String? = null - - /** - * See [AccountArrangementItem.outstandingPrincipalAmount]. - */ - var outstandingPrincipalAmount: BigDecimal? = null - - /** - * See [AccountArrangementItem.monthlyInstalmentAmount]. - */ - var monthlyInstalmentAmount: BigDecimal? = null - - /** - * See [AccountArrangementItem.amountInArrear]. - */ - var amountInArrear: BigDecimal? = null - - /** - * See [AccountArrangementItem.minimumRequiredBalance]. - */ - var minimumRequiredBalance: BigDecimal? = null - - /** - * See [AccountArrangementItem.creditCardAccountNumber]. - */ - var creditCardAccountNumber: String? = null - - /** - * See [AccountArrangementItem.validThru]. - */ - var validThru: OffsetDateTime? = null - - /** - * See [AccountArrangementItem.applicableInterestRate]. - */ - var applicableInterestRate: BigDecimal? = null - - /** - * See [AccountArrangementItem.remainingCredit]. - */ - var remainingCredit: BigDecimal? = null - - /** - * See [AccountArrangementItem.outstandingPayment]. - */ - var outstandingPayment: BigDecimal? = null - - /** - * See [AccountArrangementItem.minimumPayment]. - */ - var minimumPayment: BigDecimal? = null - - /** - * See [AccountArrangementItem.minimumPaymentDueDate]. - */ - var minimumPaymentDueDate: OffsetDateTime? = null - - /** - * See [AccountArrangementItem.totalInvestmentValue]. - */ - var totalInvestmentValue: BigDecimal? = null - - /** - * See [AccountArrangementItem.debitCards]. - */ - var debitCards: Set? = null - - /** - * See [AccountArrangementItem.accountHolderAddressLine1]. - */ - var accountHolderAddressLine1: String? = null - - /** - * See [AccountArrangementItem.accountHolderAddressLine2]. - */ - var accountHolderAddressLine2: String? = null - - /** - * See [AccountArrangementItem.accountHolderStreetName]. - */ - var accountHolderStreetName: String? = null - - /** - * See [AccountArrangementItem.town]. - */ - var town: String? = null - - /** - * See [AccountArrangementItem.postCode]. - */ - var postCode: String? = null - - /** - * See [AccountArrangementItem.countrySubDivision]. - */ - var countrySubDivision: String? = null - - /** - * See [AccountArrangementItem.accountHolderNames]. - */ - var accountHolderNames: String? = null - - /** - * See [AccountArrangementItem.accountHolderCountry]. - */ - var accountHolderCountry: String? = null - - /** - * See [AccountArrangementItem.creditAccount]. - */ - var creditAccount: Boolean? = null - - /** - * See [AccountArrangementItem.debitAccount]. - */ - var debitAccount: Boolean? = null - - /** - * See [AccountArrangementItem.lastUpdateDate]. - */ - var lastUpdateDate: OffsetDateTime? = null - - /** - * See [AccountArrangementItem.bankAlias]. - */ - var bankAlias: String? = null - - /** - * See [AccountArrangementItem.sourceId]. - */ - var sourceId: String? = null - - /** - * See [AccountArrangementItem.externalStateId]. - */ - var externalStateId: String? = null - - /** - * See [AccountArrangementItem.externalParentId]. - */ - var externalParentId: String? = null - - /** - * See [AccountArrangementItem.financialInstitutionId]. - */ - var financialInstitutionId: Long? = null - - /** - * See [AccountArrangementItem.lastSyncDate]. - */ - var lastSyncDate: OffsetDateTime? = null - - /** - * See [AccountArrangementItem.additions]. - */ - var additions: Map? = null - - /** - * See [AccountArrangementItem.unmaskableAttributes]. - */ - var unmaskableAttributes: Set? = null - - /** - * See [AccountArrangementItem.displayName]. - */ - var displayName: String? = null - - /** - * See [AccountArrangementItem.cardDetails]. - */ - var cardDetails: CardDetails? = null - - /** - * See [AccountArrangementItem.interestDetails]. - */ - var interestDetails: InterestDetails? = null - - /** - * See [AccountArrangementItem.reservedAmount]. - */ - var reservedAmount: BigDecimal? = null - - /** - * See [AccountArrangementItem.remainingPeriodicTransfers]. - */ - var remainingPeriodicTransfers: BigDecimal? = null - - /** - * See [AccountArrangementItem.nextClosingDate]. - */ - var nextClosingDate: LocalDate? = null - - /** - * See [AccountArrangementItem.overdueSince]. - */ - var overdueSince: LocalDate? = null - - /** - * See [AccountArrangementItem.externalAccountStatus]. - */ - var externalAccountStatus: String? = null - - /** - * Builds an instance of [AccountArrangementItem] - */ - @Suppress("ConstructorParameterNaming", "LongMethod") - fun build() = AccountDetail( - id = id, - productId = productId, - productKindName = productKindName, - legalEntityIds = legalEntityIds, - productTypeName = productTypeName, - externalProductId = externalProductId, - externalArrangementId = externalArrangementId, - userPreferences = userPreferences, - product = product, - state = state, - parentId = parentId, - currency = currency, - name = name, - bookedBalance = bookedBalance, - availableBalance = availableBalance, - creditLimit = creditLimit, - IBAN = IBAN, - BBAN = BBAN, - BIC = BIC, - externalTransferAllowed = externalTransferAllowed, - urgentTransferAllowed = urgentTransferAllowed, - accruedInterest = accruedInterest, - number = number, - principalAmount = principalAmount, - currentInvestmentValue = currentInvestmentValue, - productNumber = productNumber, - bankBranchCode = bankBranchCode, - bankBranchCode2 = bankBranchCode2, - accountOpeningDate = accountOpeningDate, - accountInterestRate = accountInterestRate, - valueDateBalance = valueDateBalance, - creditLimitUsage = creditLimitUsage, - creditLimitInterestRate = creditLimitInterestRate, - creditLimitExpiryDate = creditLimitExpiryDate, - startDate = startDate, - termUnit = termUnit, - termNumber = termNumber, - interestPaymentFrequencyUnit = interestPaymentFrequencyUnit, - interestPaymentFrequencyNumber = interestPaymentFrequencyNumber, - maturityDate = maturityDate, - maturityAmount = maturityAmount, - autoRenewalIndicator = autoRenewalIndicator, - interestSettlementAccount = interestSettlementAccount, - outstandingPrincipalAmount = outstandingPrincipalAmount, - monthlyInstalmentAmount = monthlyInstalmentAmount, - amountInArrear = amountInArrear, - minimumRequiredBalance = minimumRequiredBalance, - creditCardAccountNumber = creditCardAccountNumber, - validThru = validThru, - applicableInterestRate = applicableInterestRate, - remainingCredit = remainingCredit, - outstandingPayment = outstandingPayment, - minimumPayment = minimumPayment, - minimumPaymentDueDate = minimumPaymentDueDate, - totalInvestmentValue = totalInvestmentValue, - debitCards = debitCards, - accountHolderAddressLine1 = accountHolderAddressLine1, - accountHolderAddressLine2 = accountHolderAddressLine2, - accountHolderStreetName = accountHolderStreetName, - town = town, - postCode = postCode, - countrySubDivision = countrySubDivision, - accountHolderNames = accountHolderNames, - accountHolderCountry = accountHolderCountry, - creditAccount = creditAccount, - debitAccount = debitAccount, - lastUpdateDate = lastUpdateDate, - bankAlias = bankAlias, - sourceId = sourceId, - externalStateId = externalStateId, - externalParentId = externalParentId, - financialInstitutionId = financialInstitutionId, - lastSyncDate = lastSyncDate, - additions = additions, - unmaskableAttributes = unmaskableAttributes, - displayName = displayName, - cardDetails = cardDetails, - interestDetails = interestDetails, - reservedAmount = reservedAmount, - remainingPeriodicTransfers = remainingPeriodicTransfers, - nextClosingDate = nextClosingDate, - overdueSince = overdueSince, - externalAccountStatus = externalAccountStatus, - ) - } -} - -/** - * DSL to create [AccountDetail]. - * - * @see [AccountDetail]. - */ -@Suppress("FunctionName") -fun AccountDetail(initializer: AccountDetail.Builder.() -> Unit): AccountDetail { - return AccountDetail.Builder().apply(initializer).build() -} diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/AccountUserPreferences.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/AccountUserPreferences.kt deleted file mode 100644 index 648f5e07..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/AccountUserPreferences.kt +++ /dev/null @@ -1,72 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_detail - -import dev.drewhamilton.poko.Poko - -/** - * Created by Backbase R&D B.V. on 19/05/2021. - * - * User defined preferences for a specific arrangement. Note: each user might have different preferences. - * @param arrangementId The unique Arrangement identifier related to these user preferences. - * @param alias The name that can be assigned by the user to label the arrangement. - * @param visible User indicator whether to show or hide the arrangement on the front end. - * @param favorite Indication whether an arrangement can be favorable for a user. - * @param additions Additional information. - */ -@Poko -class AccountUserPreferences private constructor( - val arrangementId: String, - val alias: String?, - val visible: Boolean?, - val favorite: Boolean?, - val additions: Map? -) { - - /** - * A builder for this configuration class - */ - class Builder { - - /** - * See [AccountUserPreferences.arrangementId] - */ - lateinit var arrangementId: String - - /** - * See [AccountUserPreferences.alias] - */ - var alias: String? = null - - /** - * See [AccountUserPreferences.visible] - */ - var visible: Boolean? = null - - /** - * See [AccountUserPreferences.favorite] - */ - var favorite: Boolean? = null - - /** - * See [AccountUserPreferences.additions] - */ - var additions: Map? = null - - /** - * Build an instance of [AccountUserPreferences] - */ - fun build() = AccountUserPreferences( - arrangementId, - alias, - visible, - favorite, - additions - ) - } -} - -/** - * DSL to create [AccountUserPreferences] - */ -@JvmSynthetic -fun AccountUserPreferences(block: AccountUserPreferences.Builder.() -> Unit) = - AccountUserPreferences.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/ExternalProductItem.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/ExternalProductItem.kt deleted file mode 100644 index 56c98260..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/ExternalProductItem.kt +++ /dev/null @@ -1,71 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_detail - -import dev.drewhamilton.poko.Poko - -/** - * Created by Backbase R&D B.V. on 19/05/2021. - * - * @param externalId A unique identifier for the product that the arrangement applies to. - * @param externalTypeId The ID that is used by the Bank to identify the specific Product type - External reference to the product Type. - * @param typeName The label/name that is used to label a specific product type. - * @param productKind A string that identifies the product kind. - * @param additions Extra information. - */ -@Poko -class ExternalProductItem private constructor( - val externalId: String?, - val externalTypeId: String?, - val typeName: String?, - val productKind: ExternalProductKindItem?, - val additions: Map? -) { - - /** - * A builder for this configuration class - */ - class Builder { - - /** - * See [ExternalProductItem.externalId]. - */ - var externalId: String? = null - - /** - * See [ExternalProductItem.externalTypeId]. - */ - var externalTypeId: String? = null - - /** - * See [ExternalProductItem.typeName]. - */ - var typeName: String? = null - - /** - * See [ExternalProductItem.productKind]. - */ - var productKind: ExternalProductKindItem? = null - - /** - * See [ExternalProductItem.additions]. - */ - var additions: Map? = null - - /** - * Build an instance of [ExternalProductItem] - */ - fun build() = ExternalProductItem( - externalId = externalId, - externalTypeId = externalTypeId, - typeName = typeName, - productKind = productKind, - additions = additions - ) - } -} - -/** - * DSL to create [ExternalProductItem] - */ -@JvmSynthetic -fun ExternalProductItem(block: ExternalProductItem.Builder.() -> Unit) = - ExternalProductItem.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/ExternalProductKindItem.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/ExternalProductKindItem.kt deleted file mode 100644 index bdfc201a..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_detail/ExternalProductKindItem.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_detail - -import dev.drewhamilton.poko.Poko - -/** - * Created by Backbase R&D B.V. on 20/05/2021. - * - * @param externalKindId unique external identifier for the product kind. - * @param kindName unique product kind name. - * @param kindUri unique product kind uri. - * @param additions extra information. - */ -@Poko -class ExternalProductKindItem private constructor( - val externalKindId: String, - val kindName: String, - val kindUri: String, - val additions: Map? -) { - /** - * A builder for this configuration class - */ - class Builder { - - /** - * See [ExternalProductKindItem.externalKindId]. - */ - var externalKindId: String? = null - - /** - * See [ExternalProductKindItem.kindName]. - */ - var kindName: String? = null - - /** - * See [ExternalProductKindItem.kindUri]. - */ - var kindUri: String? = null - - /** - * See [ExternalProductKindItem.additions]. - */ - var additions: Map? = null - - /** - * Build an instance of [ExternalProductKindItem] - */ - fun build() = ExternalProductKindItem( - externalKindId = requireNotNull(externalKindId), - kindName = requireNotNull(kindName), - kindUri = requireNotNull(kindUri), - additions = additions - ) - } -} - -/** - * DSL to create [ExternalProductKindItem] - */ -@JvmSynthetic -fun ExternalProductKindItem(block: ExternalProductKindItem.Builder.() -> Unit) = - ExternalProductKindItem.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/AccountSummary.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/AccountSummary.kt deleted file mode 100644 index ed532926..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/AccountSummary.kt +++ /dev/null @@ -1,193 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.account_summary.credit_card.CreditCards -import com.backbase.accounts_journey.domain.model.account_summary.current_accounts.CurrentAccounts -import com.backbase.accounts_journey.domain.model.account_summary.custom_products.CustomProducts -import com.backbase.accounts_journey.domain.model.account_summary.debit_card.DebitCards -import com.backbase.accounts_journey.domain.model.account_summary.investment_accounts.InvestmentAccounts -import com.backbase.accounts_journey.domain.model.account_summary.loan.Loans -import com.backbase.accounts_journey.domain.model.account_summary.savings_accounts.SavingsAccounts -import com.backbase.accounts_journey.domain.model.account_summary.term_deposits.TermDeposits -import com.backbase.accounts_journey.domain.model.common.AggregatedBalance -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param customProducts The list of Custom products. - * @param aggregatedBalance The aggregated balance. - * @param currentAccounts The current accounts. - * @param savingsAccounts The saving accounts. - * @param termDeposits The term deposits. - * @param loans The loans. - * @param creditCards The credit cards. - * @param debitCards The debit cards. - * @param investmentAccounts The investments accounts. - * @param additions The additions. - */ -@Suppress("LongParameterList") -@Poko -@Parcelize -class AccountSummary private constructor( - val customProducts: List, - val aggregatedBalance: AggregatedBalance?, - val currentAccounts: CurrentAccounts?, - val savingsAccounts: SavingsAccounts?, - val termDeposits: TermDeposits?, - val loans: Loans?, - val creditCards: CreditCards?, - val debitCards: DebitCards?, - val investmentAccounts: InvestmentAccounts?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [AccountSummary.customProducts] - */ - var customProducts: List = emptyList() - - /** - * See [AccountSummary.aggregatedBalance] - */ - var aggregatedBalance: AggregatedBalance? = null - - /** - * See [AccountSummary.currentAccounts] - */ - var currentAccounts: CurrentAccounts? = null - - /** - * See [AccountSummary.savingsAccounts] - */ - var savingsAccounts: SavingsAccounts? = null - - /** - * See [AccountSummary.termDeposits] - */ - var termDeposits: TermDeposits? = null - - /** - * See [AccountSummary.loans] - */ - var loans: Loans? = null - - /** - * See [AccountSummary.creditCards] - */ - var creditCards: CreditCards? = null - - /** - * See [AccountSummary.debitCards] - */ - var debitCards: DebitCards? = null - - /** - * See [AccountSummary.investmentAccounts] - */ - var investmentAccounts: InvestmentAccounts? = null - - /** - * See [AccountSummary.additions] - */ - var additions: Map? = null - - /** - * See [AccountSummary.customProducts] - */ - fun setCustoms(customs: List) = apply { - this.customProducts = customs - } - - /** - * See [AccountSummary.aggregatedBalance] - */ - fun setAggregatedBalance(aggregatedBalance: AggregatedBalance?) = apply { - this.aggregatedBalance = aggregatedBalance - } - - /** - * See [AccountSummary.currentAccounts] - */ - fun setCurrentAccounts(currentAccounts: CurrentAccounts?) = apply { - this.currentAccounts = currentAccounts - } - - /** - * See [AccountSummary.savingsAccounts] - */ - fun setSavingsAccounts(savingsAccounts: SavingsAccounts?) = apply { - this.savingsAccounts = savingsAccounts - } - - /** - * See [AccountSummary.termDeposits] - */ - fun setTermDeposits(termDeposits: TermDeposits?) = apply { - this.termDeposits = termDeposits - } - - /** - * See [AccountSummary.loans] - */ - fun setLoans(loans: Loans?) = apply { - this.loans = loans - } - - /** - * See [AccountSummary.creditCards] - */ - fun setCreditCards(creditCards: CreditCards?) = apply { - this.creditCards = creditCards - } - - /** - * See [AccountSummary.debitCards] - */ - fun setDebitCards(debitCards: DebitCards?) = apply { - this.debitCards = debitCards - } - - /** - * See [AccountSummary.investmentAccounts] - */ - fun setInvestmentAccounts(investmentAccounts: InvestmentAccounts?) = apply { - this.investmentAccounts = investmentAccounts - } - - /** - * See [AccountSummary.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Build an instance of [AccountSummary] - */ - fun build() = AccountSummary( - customProducts, - aggregatedBalance, - currentAccounts, - savingsAccounts, - termDeposits, - loans, - creditCards, - debitCards, - investmentAccounts, - additions - ) - } -} - -/** - * DSL to create [AccountSummary] - */ -fun AccountSummary(block: AccountSummary.Builder.() -> Unit) = AccountSummary.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/MaskableAttribute.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/MaskableAttribute.kt deleted file mode 100644 index 87ff1873..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/MaskableAttribute.kt +++ /dev/null @@ -1,30 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * Supported Masking/unMasking for Account Number on Account Detail Screen. - * ## Important - * Do not use this enum or its cases in exhaustive searches, at least not without an else branch. - * New cases will be added to this enum in the future. - * - * @param attributeName the name of the DBS attribute - */ - -enum class MaskableAttribute(val attributeName: String) { - - /** - * IBAN - */ - IBAN(attributeName = "IBAN"), - - /** - * BBAN - */ - BBAN(attributeName = "BBAN"), - - /** - * Number - */ - Number(attributeName = "Number") -} diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/UserPreferences.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/UserPreferences.kt deleted file mode 100644 index db10a751..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/UserPreferences.kt +++ /dev/null @@ -1,93 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary - -import android.os.Parcelable -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param alias The name that can be assigned by the user to label the arrangement - * @param visible User indicator whether to show or hide the arrangement on the front end - * @param favorite Indication whether an arrangement can be favorable for a user - * @param additions Extra parameters - */ -@Poko -@Parcelize -class UserPreferences internal constructor( - val alias: String?, - val visible: Boolean?, - val favorite: Boolean?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [UserPreferences.alias] - */ - var alias: String? = null - - /** - * See [UserPreferences.visible] - */ - var visible: Boolean? = null - - /** - * See [UserPreferences.favorite] - */ - var favorite: Boolean? = null - - /** - * See [UserPreferences.additions] - */ - var additions: Map? = null - - /** - * See [UserPreferences.alias] - */ - fun setAlias(alias: String?) = apply { - this.alias = alias - } - - /** - * See [UserPreferences.visible] - */ - fun setVisible(visible: Boolean?) = apply { - this.visible = visible - } - - /** - * See [UserPreferences.favorite] - */ - fun setFavorite(favorite: Boolean?) = apply { - this.favorite = favorite - } - - /** - * See [UserPreferences.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Build an instance of [UserPreferences] - */ - fun build() = UserPreferences( - alias, - visible, - favorite, - additions - ) - } -} - -/** - * DSL to create [UserPreferences] - */ -fun UserPreferences(block: UserPreferences.Builder.() -> Unit) = UserPreferences.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/credit_card/CreditCard.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/credit_card/CreditCard.kt deleted file mode 100644 index c017b446..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/credit_card/CreditCard.kt +++ /dev/null @@ -1,671 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.credit_card - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import com.backbase.accounts_journey.domain.model.common.BaseProduct -import com.backbase.accounts_journey.domain.model.common.CardDetails -import com.backbase.accounts_journey.domain.model.common.InterestDetails -import com.backbase.accounts_journey.domain.model.common.ProductState -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal -import java.time.LocalDate -import java.time.OffsetDateTime - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param bookedBalance - * @param availableBalance - * @param creditLimit - * @param number First 6 and/or last 4 digits of a Payment card. All other digits will/to be masked. Be aware that using card number differently is potential PCI risk. - * @param unMaskableAttributes An optional list of the maskable attributes that can be unmasked. - * @param currency - * @param bankBranchCode2 (This is to accomodate additional country specific fields fedwire Routing Nmber) - * @param urgentTransferAllowed Defines if urgent transfer is allowed. - * @param cardNumber - * @param creditCardAccountNumber The number of the account the credit card transactions settle on (so actually the reference to the settlement account of the card)? - * @param validThru Expiration date of a credit card, after which is no longer valid. - * @param applicableInterestRate The interest rate or rates which would be used for a particular arrangement. - * @param remainingCredit - * @param outstandingPayment - * @param minimumPayment The minimum payment set a percentage of balance, or a fixed cash amount. - * @param minimumPaymentDueDate Minimum Payment Due Date shown on your monthly statement to remain in good standing. - * @param accountInterestRate The annualized cost of credit or debt-capital computed as the percentage ratio of interest to the principal. - * @param accountHolderNames Party(s) with a relationship to the account. - * @param creditLimitUsage Monetary amount of the used overdraft. - * @param creditLimitInterestRate Overdraft Interest is an interest applied to the account for any time throughout the month when the account is overdrawn. - * @param accruedInterest - * @param id Reference to the product of which the arrangement is an instantiation. - * @param name - * @param externalTransferAllowed Defines if transfer to another party is allowed. - * @param crossCurrencyAllowed Defines if cross currency transfer is allowed - * @param productKindName The label/name that is used for the respective product kind - * @param productTypeName The label/name that is used to label a specific product type - * @param bankAlias The name that can be assigned by the bank to label the arrangement. - * @param sourceId Indicate if the account is regular or external - * @param accountOpeningDate - * @param lastUpdateDate Last date of parameter update for the arrangement. - * @param userPreferences The preferences configured by the user. - * @param state - * @param parentId Reference to the parent of the arrangement. - * @param subArrangements A list of arrangements whose parent is this product. - * @param financialInstitutionId Financial institution ID - * @param lastSyncDate Last synchronization datetime - * @param additions Extra parameters - * @param displayName name of the particular product - * @param cardDetails - * @param interestDetails - * @param reservedAmount The reservation of a portion of a credit or debit balance for the cost of services not yet rendered. - * @param remainingPeriodicTransfers The limitation in periodic saving transfers or withdrawals. In the case of the US, Regulation D enables for a maximum of 6 monthly savings transfers or withdrawals. - * @param nextClosingDate The last day of the forthcoming billing cycle. - * @param overdueSince The date in which the arrangement has been overdue since. - * @param externalAccountStatus Synchronization statuses an account can have on the provider side after it has been aggregated. - */ -@Suppress("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class CreditCard internal constructor( - val bookedBalance: String?, - val availableBalance: String?, - val creditLimit: String?, - val number: String?, - val unMaskableAttributes: Set?, - val currency: String?, - val bankBranchCode2: String?, - val urgentTransferAllowed: Boolean?, - val cardNumber: BigDecimal?, - val creditCardAccountNumber: String?, - val validThru: OffsetDateTime?, - val applicableInterestRate: BigDecimal?, - val remainingCredit: BigDecimal?, - val outstandingPayment: BigDecimal?, - val minimumPayment: BigDecimal?, - val minimumPaymentDueDate: OffsetDateTime?, - val accountInterestRate: BigDecimal?, - val accountHolderNames: String?, - val creditLimitUsage: BigDecimal?, - val creditLimitInterestRate: BigDecimal?, - val accruedInterest: BigDecimal?, - val id: String?, - val name: String?, - val externalTransferAllowed: Boolean?, - val crossCurrencyAllowed: Boolean?, - val productKindName: String?, - val productTypeName: String?, - val bankAlias: String?, - val sourceId: String?, - val accountOpeningDate: OffsetDateTime?, - val lastUpdateDate: OffsetDateTime?, - val userPreferences: UserPreferences?, - val state: ProductState?, - val parentId: String?, - val subArrangements: List?, - val financialInstitutionId: Long?, - val lastSyncDate: OffsetDateTime?, - val additions: Map?, - val displayName: String?, - val cardDetails: CardDetails?, - val interestDetails: InterestDetails?, - val reservedAmount: BigDecimal?, - val remainingPeriodicTransfers: BigDecimal?, - val nextClosingDate: LocalDate?, - val overdueSince: LocalDate?, - val externalAccountStatus: String?, -) : Parcelable { - - /** - * A builder for [CreditCard]. - */ - class Builder { - - /** - * See [CreditCard.bookedBalance]. - */ - var bookedBalance: String? = null - - /** - * See [CreditCard.availableBalance]. - */ - var availableBalance: String? = null - - /** - * See [CreditCard.creditLimit]. - */ - var creditLimit: String? = null - - /** - * See [CreditCard.number]. - */ - var number: String? = null - - /** - * See [CreditCard.unMaskableAttributes]. - */ - var unMaskableAttributes: Set? = null - - /** - * See [CreditCard.currency]. - */ - var currency: String? = null - - /** - * See [CreditCard.bankBranchCode2]. - */ - var bankBranchCode2: String? = null - - /** - * See [CreditCard.urgentTransferAllowed]. - */ - var urgentTransferAllowed: Boolean? = null - - /** - * See [CreditCard.cardNumber]. - */ - var cardNumber: BigDecimal? = null - - /** - * See [CreditCard.creditCardAccountNumber]. - */ - var creditCardAccountNumber: String? = null - - /** - * See [CreditCard.validThru]. - */ - var validThru: OffsetDateTime? = null - - /** - * See [CreditCard.applicableInterestRate]. - */ - var applicableInterestRate: BigDecimal? = null - - /** - * See [CreditCard.remainingCredit]. - */ - var remainingCredit: BigDecimal? = null - - /** - * See [CreditCard.outstandingPayment]. - */ - var outstandingPayment: BigDecimal? = null - - /** - * See [CreditCard.minimumPayment]. - */ - var minimumPayment: BigDecimal? = null - - /** - * See [CreditCard.minimumPaymentDueDate]. - */ - var minimumPaymentDueDate: OffsetDateTime? = null - - /** - * See [CreditCard.accountInterestRate]. - */ - var accountInterestRate: BigDecimal? = null - - /** - * See [CreditCard.accountHolderNames]. - */ - var accountHolderNames: String? = null - - /** - * See [CreditCard.creditLimitUsage]. - */ - var creditLimitUsage: BigDecimal? = null - - /** - * See [CreditCard.creditLimitInterestRate]. - */ - var creditLimitInterestRate: BigDecimal? = null - - /** - * See [CreditCard.accruedInterest]. - */ - var accruedInterest: BigDecimal? = null - - /** - * See [CreditCard.id]. - */ - var id: String? = null - - /** - * See [CreditCard.name]. - */ - var name: String? = null - - /** - * See [CreditCard.externalTransferAllowed]. - */ - var externalTransferAllowed: Boolean? = null - - /** - * See [CreditCard.crossCurrencyAllowed]. - */ - var crossCurrencyAllowed: Boolean? = null - - /** - * See [CreditCard.productKindName]. - */ - var productKindName: String? = null - - /** - * See [CreditCard.productTypeName]. - */ - var productTypeName: String? = null - - /** - * See [CreditCard.bankAlias]. - */ - var bankAlias: String? = null - - /** - * See [CreditCard.sourceId]. - */ - var sourceId: String? = null - - /** - * See [CreditCard.accountOpeningDate]. - */ - var accountOpeningDate: OffsetDateTime? = null - - /** - * See [CreditCard.lastUpdateDate]. - */ - var lastUpdateDate: OffsetDateTime? = null - - /** - * See [CreditCard.userPreferences]. - */ - var userPreferences: UserPreferences? = null - - /** - * See [CreditCard.state]. - */ - var state: ProductState? = null - - /** - * See [CreditCard.parentId]. - */ - var parentId: String? = null - - /** - * See [CreditCard.subArrangements]. - */ - var subArrangements: List? = null - - /** - * See [CreditCard.financialInstitutionId]. - */ - var financialInstitutionId: Long? = null - - /** - * See [CreditCard.lastSyncDate]. - */ - var lastSyncDate: OffsetDateTime? = null - - /** - * See [CreditCard.additions]. - */ - var additions: Map? = null - - /** - * See [CreditCard.displayName]. - */ - var displayName: String? = null - - /** - * See [CreditCard.cardDetails]. - */ - var cardDetails: CardDetails? = null - - /** - * See [CreditCard.interestDetails]. - */ - var interestDetails: InterestDetails? = null - - /** - * See [CreditCard.reservedAmount]. - */ - var reservedAmount: BigDecimal? = null - - /** - * See [CreditCard.remainingPeriodicTransfers]. - */ - var remainingPeriodicTransfers: BigDecimal? = null - - /** - * See [CreditCard.nextClosingDate]. - */ - var nextClosingDate: LocalDate? = null - - /** - * See [CreditCard.overdueSince]. - */ - var overdueSince: LocalDate? = null - - /** - * See [CreditCard.externalAccountStatus]. - */ - var externalAccountStatus: String? = null - - /** - * See [CreditCard.bookedBalance]. - */ - fun setBookedBalance(bookedBalance: String?) = apply { this.bookedBalance = bookedBalance } - - /** - * See [CreditCard.availableBalance]. - */ - fun setAvailableBalance(availableBalance: String?) = apply { this.availableBalance = availableBalance } - - /** - * See [CreditCard.creditLimit]. - */ - fun setCreditLimit(creditLimit: String?) = apply { this.creditLimit = creditLimit } - - /** - * See [CreditCard.number]. - */ - fun setNumber(number: String?) = apply { this.number = number } - - /** - * See [CreditCard.unMaskableAttributes]. - */ - fun setUnMaskableAttributes(unMaskableAttributes: Set?) = - apply { this.unMaskableAttributes = unMaskableAttributes } - - /** - * See [CreditCard.currency]. - */ - fun setCurrency(currency: String?) = apply { this.currency = currency } - - /** - * See [CreditCard.bankBranchCode2]. - */ - fun setBankBranchCode2(bankBranchCode2: String?) = apply { this.bankBranchCode2 = bankBranchCode2 } - - /** - * See [CreditCard.urgentTransferAllowed]. - */ - fun setUrgentTransferAllowed(urgentTransferAllowed: Boolean?) = - apply { this.urgentTransferAllowed = urgentTransferAllowed } - - /** - * See [CreditCard.cardNumber]. - */ - fun setCardNumber(cardNumber: BigDecimal?) = apply { this.cardNumber = cardNumber } - - /** - * See [CreditCard.creditCardAccountNumber]. - */ - fun setCreditCardAccountNumber(creditCardAccountNumber: String?) = - apply { this.creditCardAccountNumber = creditCardAccountNumber } - - /** - * See [CreditCard.validThru]. - */ - fun setValidThru(validThru: OffsetDateTime?) = apply { this.validThru = validThru } - - /** - * See [CreditCard.applicableInterestRate]. - */ - fun setApplicableInterestRate(applicableInterestRate: BigDecimal?) = - apply { this.applicableInterestRate = applicableInterestRate } - - /** - * See [CreditCard.remainingCredit]. - */ - fun setRemainingCredit(remainingCredit: BigDecimal?) = - apply { this.remainingCredit = remainingCredit } - - /** - * See [CreditCard.outstandingPayment]. - */ - fun setOutstandingPayment(outstandingPayment: BigDecimal?) = - apply { this.outstandingPayment = outstandingPayment } - - /** - * See [CreditCard.minimumPayment]. - */ - fun setMinimumPayment(minimumPayment: BigDecimal?) = apply { this.minimumPayment = minimumPayment } - - /** - * See [CreditCard.minimumPaymentDueDate]. - */ - fun setMinimumPaymentDueDate(minimumPaymentDueDate: OffsetDateTime?) = - apply { this.minimumPaymentDueDate = minimumPaymentDueDate } - - /** - * See [CreditCard.accountInterestRate]. - */ - fun setAccountInterestRate(accountInterestRate: BigDecimal?) = - apply { this.accountInterestRate = accountInterestRate } - - /** - * See [CreditCard.accountHolderNames]. - */ - fun setAccountHolderNames(accountHolderNames: String?) = - apply { this.accountHolderNames = accountHolderNames } - - /** - * See [CreditCard.creditLimitUsage]. - */ - fun setCreditLimitUsage(creditLimitUsage: BigDecimal?) = - apply { this.creditLimitUsage = creditLimitUsage } - - /** - * See [CreditCard.creditLimitInterestRate]. - */ - fun setCreditLimitInterestRate(creditLimitInterestRate: BigDecimal?) = - apply { this.creditLimitInterestRate = creditLimitInterestRate } - - /** - * See [CreditCard.accruedInterest]. - */ - fun setAccruedInterest(accruedInterest: BigDecimal?) = - apply { this.accruedInterest = accruedInterest } - - /** - * See [CreditCard.id]. - */ - fun setId(id: String?) = apply { this.id = id } - - /** - * See [CreditCard.name]. - */ - fun setName(name: String?) = apply { this.name = name } - - /** - * See [CreditCard.externalTransferAllowed]. - */ - fun setExternalTransferAllowed(externalTransferAllowed: Boolean?) = - apply { this.externalTransferAllowed = externalTransferAllowed } - - /** - * See [CreditCard.crossCurrencyAllowed]. - */ - fun setCrossCurrencyAllowed(crossCurrencyAllowed: Boolean?) = - apply { this.crossCurrencyAllowed = crossCurrencyAllowed } - - /** - * See [CreditCard.productKindName]. - */ - fun setProductKindName(productKindName: String?) = apply { this.productKindName = productKindName } - - /** - * See [CreditCard.productTypeName]. - */ - fun setProductTypeName(productTypeName: String?) = apply { this.productTypeName = productTypeName } - - /** - * See [CreditCard.bankAlias]. - */ - fun setBankAlias(bankAlias: String?) = apply { this.bankAlias = bankAlias } - - /** - * See [CreditCard.sourceId]. - */ - fun setSourceId(sourceId: String?) = apply { this.sourceId = sourceId } - - /** - * See [CreditCard.accountOpeningDate]. - */ - fun setAccountOpeningDate(accountOpeningDate: OffsetDateTime?) = - apply { this.accountOpeningDate = accountOpeningDate } - - /** - * See [CreditCard.lastUpdateDate]. - */ - fun setLastUpdateDate(lastUpdateDate: OffsetDateTime?) = - apply { this.lastUpdateDate = lastUpdateDate } - - /** - * See [CreditCard.userPreferences]. - */ - fun setUserPreferences(userPreferences: UserPreferences?) = apply { this.userPreferences = userPreferences } - - /** - * See [CreditCard.state]. - */ - fun setState(state: ProductState?) = apply { this.state = state } - - /** - * See [CreditCard.parentId]. - */ - fun setParentId(parentId: String?) = apply { this.parentId = parentId } - - /** - * See [CreditCard.subArrangements]. - */ - fun setSubArrangements(subArrangements: List?) = apply { - this.subArrangements = subArrangements - } - - /** - * See [CreditCard.financialInstitutionId]. - */ - fun setFinancialInstitutionId(financialInstitutionId: Long?) = - apply { this.financialInstitutionId = financialInstitutionId } - - /** - * See [CreditCard.lastSyncDate]. - */ - fun setLastSyncDate(lastSyncDate: OffsetDateTime?) = apply { this.lastSyncDate = lastSyncDate } - - /** - * See [CreditCard.additions]. - */ - fun setAdditions(additions: Map?) = - apply { this.additions = additions } - - /** - * See [CreditCard.displayName]. - */ - fun setDisplayName(displayName: String?) = - apply { this.displayName = displayName } - - /** - * See [CreditCard.cardDetails]. - */ - fun setCardDetails(cardDetails: CardDetails?) = - apply { this.cardDetails = cardDetails } - - /** - * See [CreditCard.reservedAmount]. - */ - fun setReservedAmount(reservedAmount: BigDecimal?) = - apply { this.reservedAmount = reservedAmount } - - /** - * See [CreditCard.remainingPeriodicTransfers]. - */ - fun setRemainingPeriodicTransfers(remainingPeriodicTransfers: BigDecimal?) = - apply { this.remainingPeriodicTransfers = remainingPeriodicTransfers } - - /** - * See [CreditCard.nextClosingDate]. - */ - fun setNextClosingDate(nextClosingDate: LocalDate?) = - apply { this.nextClosingDate = nextClosingDate } - - /** - * See [CreditCard.overdueSince]. - */ - fun setOverdueSince(overdueSince: LocalDate?) = - apply { this.overdueSince = overdueSince } - - /** - * See [CreditCard.externalAccountStatus]. - */ - fun setExternalAccountStatus(externalAccountStatus: String?) = - apply { this.externalAccountStatus = externalAccountStatus } - - /** - * See [CreditCard.interestDetails]. - */ - fun setInterestDetails(interestDetails: InterestDetails?) = - apply { this.interestDetails = interestDetails } - - /** - * Builds an instance of [CreditCard]. - */ - fun build() = CreditCard( - bookedBalance = bookedBalance, - availableBalance = availableBalance, - creditLimit = creditLimit, - number = number, - unMaskableAttributes = unMaskableAttributes, - currency = currency, - bankBranchCode2 = bankBranchCode2, - urgentTransferAllowed = urgentTransferAllowed, - cardNumber = cardNumber, - creditCardAccountNumber = creditCardAccountNumber, - validThru = validThru, - applicableInterestRate = applicableInterestRate, - remainingCredit = remainingCredit, - outstandingPayment = outstandingPayment, - minimumPayment = minimumPayment, - minimumPaymentDueDate = minimumPaymentDueDate, - accountInterestRate = accountInterestRate, - accountHolderNames = accountHolderNames, - creditLimitUsage = creditLimitUsage, - creditLimitInterestRate = creditLimitInterestRate, - accruedInterest = accruedInterest, - id = id, - name = name, - externalTransferAllowed = externalTransferAllowed, - crossCurrencyAllowed = crossCurrencyAllowed, - productKindName = productKindName, - productTypeName = productTypeName, - bankAlias = bankAlias, - sourceId = sourceId, - accountOpeningDate = accountOpeningDate, - lastUpdateDate = lastUpdateDate, - userPreferences = userPreferences, - state = state, - parentId = parentId, - subArrangements = subArrangements, - financialInstitutionId = financialInstitutionId, - lastSyncDate = lastSyncDate, - additions = additions, - displayName = displayName, - cardDetails = cardDetails, - interestDetails = interestDetails, - reservedAmount = reservedAmount, - remainingPeriodicTransfers = remainingPeriodicTransfers, - nextClosingDate = nextClosingDate, - overdueSince = overdueSince, - externalAccountStatus = externalAccountStatus, - ) - } -} - -/** - * Builds an instance of [CreditCard] with the [initializer] parameters. - */ -@Suppress("FunctionName") // DSL initializer -fun CreditCard(initializer: CreditCard.Builder.() -> Unit): CreditCard { - return CreditCard.Builder().apply(initializer).build() -} diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/credit_card/CreditCards.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/credit_card/CreditCards.kt deleted file mode 100644 index f44215e8..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/credit_card/CreditCards.kt +++ /dev/null @@ -1,96 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.credit_card - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.common.AggregatedBalance -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param products List of credit cards - * @param name The label/name of the Credit card - * @param aggregatedBalance The aggregated balance of this group of products. - * @param additions Extra parameters - */ -@Poko -@Parcelize -class CreditCards private constructor( - val products: List, - val name: String?, - val aggregatedBalance: AggregatedBalance?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [CreditCards.products] - */ - var products: List? = null - - /** - * See [CreditCards.name] - */ - var name: String? = null - - /** - * See [CreditCards.aggregatedBalance] - */ - var aggregatedBalance: AggregatedBalance? = null - - /** - * See [CreditCards.additions] - */ - var additions: Map? = null - - /** - * See [CreditCards.products] - */ - fun setProducts(products: List) = apply { - this.products = products - } - - /** - * See [CreditCards.name] - */ - fun setName(name: String?) = apply { - this.name = name - } - - /** - * See [CreditCards.aggregatedBalance] - */ - fun setAggregatedBalance(aggregatedBalance: AggregatedBalance?) = apply { - this.aggregatedBalance = aggregatedBalance - } - - /** - * See [CreditCards.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Builds an instance of [CreditCards] - */ - fun build() = CreditCards( - requireNotNull(products), - name, - aggregatedBalance, - additions - ) - } -} - -/** - * DSL to create [CreditCards] - */ -fun CreditCards(block: CreditCards.Builder.() -> Unit) = CreditCards.Builder().apply(block).build() - -internal fun CreditCards?.allProducts(): List = this?.products ?: emptyList() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/current_accounts/CurrentAccount.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/current_accounts/CurrentAccount.kt deleted file mode 100644 index fa875f78..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/current_accounts/CurrentAccount.kt +++ /dev/null @@ -1,869 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.current_accounts - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import com.backbase.accounts_journey.domain.model.common.BaseProduct -import com.backbase.accounts_journey.domain.model.common.CardDetails -import com.backbase.accounts_journey.domain.model.common.DebitCardItem -import com.backbase.accounts_journey.domain.model.common.InterestDetails -import com.backbase.accounts_journey.domain.model.common.ProductState -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal -import java.time.LocalDate -import java.time.OffsetDateTime - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param debitCardItems A list of debit cards associated with this product. - * @param bookedBalance - * @param availableBalance - * @param creditLimit - * @param IBAN The International Bank Account Number. If specified, it must be a valid IBAN, otherwise an invalid value error could be raised. - * @param BBAN Specifying the BBAN of the account - BBAN is short for Basic Bank Account Number. It represents a country-specific bank account number. - * @param BIC Bank Identifier Code - international bank code that identifies particular banks worldwide - * @param unMaskableAttributes An optional list of the maskable attributes that can be unmasked. - * @param currency The alpha-3 code (complying with ISO 4217) of the currency that qualifies the amount. - * @param urgentTransferAllowed Defines if urgent transfer is allowed. - * @param bankBranchCode (This is to accomodate additional country specific fields like Sort Code in UK) - * @param bankBranchCode2 (This is to accomodate additional country specific fields fedwire Routing Nmber) - * @param accountInterestRate The annualized cost of credit or debt-capital computed as the percentage ratio of interest to the principal. - * @param valueDateBalance The balance of the account on a specific date that needs to be used for the calculation of interest. NB! If no date is specified (like for the book date balance) the current date can be assumed. - * @param creditLimitUsage Monetary amount of the used overdraft. - * @param creditLimitInterestRate Overdraft Interest is an interest applied to the account for any time throughout the month when the account is overdrawn. - * @param creditLimitExpiryDate The date after which overdraft will no longer be available to the account (renewed automatically or cancelled). - * @param accruedInterest - * @param accountHolderNames Party(s) with a relationship to the account. - * @param startDate - * @param minimumRequiredBalance Minimum amount that a customer must have in an account in order to receive some sort of service, such as keeping the account open or receive interest. - * @param accountHolderAddressLine1 Address of the Payer/Payee - Alternate address line for the account. - * @param accountHolderAddressLine2 Address of the Payer/Payee - Alternate address line for the account. - * @param accountHolderStreetName Street name of the Payer/Payee - Alternate street name for the account. - * @param town Town of the Payer/Payee - Alternate town for the account. - * @param postCode The postcode of the account holder address. - * @param countrySubDivision The country sub division, if any. - * @param creditAccount Indicator whether or not the arrangement can be used in payment orders as credit account. - * @param debitAccount Indicator whether or not the arrangement can be used in payment orders as debit account. - * @param accountHolderCountry Country of the account holder - * @param id Reference to the product of which the arrangement is an instantiation. - * @param name The name of this particular product. - * @param externalTransferAllowed Defines if transfer to another party is allowed. - * @param crossCurrencyAllowed Defines if cross currency transfer is allowed - * @param productKindName The label/name that is used for the respective product kind - * @param productTypeName The label/name that is used to label a specific product type - * @param bankAlias The name that can be assigned by the bank to label the arrangement. - * @param sourceId Indicate if the account is regular or external - * @param accountOpeningDate - * @param lastUpdateDate Last date of parameter update for the arrangement. - * @param userPreferences The preferences configured by the user. - * @param state - * @param parentId Reference to the parent of the arrangement. - * @param subArrangements A list of arrangements whose parent is this product. - * @param financialInstitutionId Financial institution ID - * @param lastSyncDate Last synchronization datetime - * @param additions Extra information. - * @param displayName name of the particular product - * @param cardDetails - * @param interestDetails - * @param reservedAmount The reservation of a portion of a credit or debit balance for the cost of services not yet rendered. - * @param remainingPeriodicTransfers The limitation in periodic saving transfers or withdrawals. In the case of the US, Regulation D enables for a maximum of 6 monthly savings transfers or withdrawals. - * @param nextClosingDate The last day of the forthcoming billing cycle. - * @param overdueSince The date in which the arrangement has been overdue since. - * @param externalAccountStatus Synchronization statuses an account can have on the provider side after it has been aggregated. - */ -@Suppress("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class CurrentAccount internal constructor( - val debitCardItems: Set, - val bookedBalance: String?, - val availableBalance: String?, - val creditLimit: String?, - @SuppressWarnings("ConstructorParameterNaming") val IBAN: String?, - @SuppressWarnings("ConstructorParameterNaming") val BBAN: String?, - @SuppressWarnings("ConstructorParameterNaming") val BIC: String?, - val unMaskableAttributes: Set?, - val currency: String?, - val urgentTransferAllowed: Boolean?, - val bankBranchCode: String?, - val bankBranchCode2: String?, - val accountInterestRate: BigDecimal?, - val valueDateBalance: BigDecimal?, - val creditLimitUsage: BigDecimal?, - val creditLimitInterestRate: BigDecimal?, - val creditLimitExpiryDate: OffsetDateTime?, - val accruedInterest: BigDecimal?, - val startDate: OffsetDateTime?, - val minimumRequiredBalance: BigDecimal?, - val accountHolderAddressLine1: String?, - val accountHolderAddressLine2: String?, - val accountHolderStreetName: String?, - val town: String?, - val postCode: String?, - val countrySubDivision: String?, - val accountHolderNames: String?, - val accountHolderCountry: String?, - val creditAccount: Boolean?, - val debitAccount: Boolean?, - val id: String?, - val name: String?, - val externalTransferAllowed: Boolean?, - val crossCurrencyAllowed: Boolean?, - val productKindName: String?, - val productTypeName: String?, - val bankAlias: String?, - val sourceId: String?, - val accountOpeningDate: OffsetDateTime?, - val lastUpdateDate: OffsetDateTime?, - val userPreferences: UserPreferences?, - val state: ProductState?, - val parentId: String?, - val subArrangements: List?, - val financialInstitutionId: Long?, - val lastSyncDate: OffsetDateTime?, - val additions: Map?, - val displayName: String?, - val cardDetails: CardDetails?, - val interestDetails: InterestDetails?, - val reservedAmount: BigDecimal?, - val remainingPeriodicTransfers: BigDecimal?, - val nextClosingDate: LocalDate?, - val overdueSince: LocalDate?, - val externalAccountStatus: String?, -) : Parcelable { - - /** - * A builder for this configuration class. - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function. - */ - class Builder { - - /** - * See [CurrentAccount.debitCardItems]. - */ - var debitCardItems: Set? = null - - /** - * See [CurrentAccount.bookedBalance]. - */ - var bookedBalance: String? = null - - /** - * See [CurrentAccount.availableBalance]. - */ - var availableBalance: String? = null - - /** - * See [CurrentAccount.creditLimit]. - */ - var creditLimit: String? = null - - /** - * See [CurrentAccount.IBAN]. - */ - @SuppressWarnings("VariableNaming") - var IBAN: String? = null - - /** - * See [CurrentAccount.BBAN]. - */ - @SuppressWarnings("VariableNaming") - var BBAN: String? = null - - /** - * See [CurrentAccount.BIC]. - */ - @SuppressWarnings("VariableNaming") - var BIC: String? = null - - /** - * See [CurrentAccount.unMaskableAttributes]. - */ - var unMaskableAttributes: Set? = null - - /** - * See [CurrentAccount.currency]. - */ - var currency: String? = null - - /** - * See [CurrentAccount.urgentTransferAllowed]. - */ - var urgentTransferAllowed: Boolean? = null - - /** - * See [CurrentAccount.bankBranchCode]. - */ - var bankBranchCode: String? = null - - /** - * See [CurrentAccount.bankBranchCode2]. - */ - var bankBranchCode2: String? = null - - /** - * See [CurrentAccount.accountInterestRate]. - */ - var accountInterestRate: BigDecimal? = null - - /** - * See [CurrentAccount.valueDateBalance]. - */ - var valueDateBalance: BigDecimal? = null - - /** - * See [CurrentAccount.creditLimitUsage]. - */ - var creditLimitUsage: BigDecimal? = null - - /** - * See [CurrentAccount.creditLimitInterestRate]. - */ - var creditLimitInterestRate: BigDecimal? = null - - /** - * See [CurrentAccount.creditLimitExpiryDate]. - */ - var creditLimitExpiryDate: OffsetDateTime? = null - - /** - * See [CurrentAccount.accruedInterest]. - */ - var accruedInterest: BigDecimal? = null - - /** - * See [CurrentAccount.startDate]. - */ - var startDate: OffsetDateTime? = null - - /** - * See [CurrentAccount.minimumRequiredBalance]. - */ - var minimumRequiredBalance: BigDecimal? = null - - /** - * See [CurrentAccount.accountHolderAddressLine1]. - */ - var accountHolderAddressLine1: String? = null - - /** - * See [CurrentAccount.accountHolderAddressLine2]. - */ - var accountHolderAddressLine2: String? = null - - /** - * See [CurrentAccount.accountHolderStreetName]. - */ - var accountHolderStreetName: String? = null - - /** - * See [CurrentAccount.town]. - */ - var town: String? = null - - /** - * See [CurrentAccount.postCode]. - */ - var postCode: String? = null - - /** - * See [CurrentAccount.countrySubDivision]. - */ - var countrySubDivision: String? = null - - /** - * See [CurrentAccount.accountHolderNames]. - */ - var accountHolderNames: String? = null - - /** - * See [CurrentAccount.accountHolderCountry]. - */ - var accountHolderCountry: String? = null - - /** - * See [CurrentAccount.creditAccount]. - */ - var creditAccount: Boolean? = null - - /** - * See [CurrentAccount.debitAccount]. - */ - var debitAccount: Boolean? = null - - /** - * See [CurrentAccount.externalTransferAllowed]. - */ - var externalTransferAllowed: Boolean? = null - - /** - * See [CurrentAccount.crossCurrencyAllowed]. - */ - var crossCurrencyAllowed: Boolean? = null - - /** - * See [CurrentAccount.id]. - */ - var id: String? = null - - /** - * See [CurrentAccount.name]. - */ - var name: String? = null - - /** - * See [CurrentAccount.productKindName]. - */ - var productKindName: String? = null - - /** - * See [CurrentAccount.productTypeName]. - */ - var productTypeName: String? = null - - /** - * See [CurrentAccount.bankAlias]. - */ - var bankAlias: String? = null - - /** - * See [CurrentAccount.sourceId]. - */ - var sourceId: String? = null - - /** - * See [CurrentAccount.parentId]. - */ - var parentId: String? = null - - /** - * See [CurrentAccount.accountOpeningDate]. - */ - var accountOpeningDate: OffsetDateTime? = null - - /** - * See [CurrentAccount.lastUpdateDate]. - */ - var lastUpdateDate: OffsetDateTime? = null - - /** - * See [CurrentAccount.lastSyncDate]. - */ - var lastSyncDate: OffsetDateTime? = null - - /** - * See [CurrentAccount.userPreferences]. - */ - var userPreferences: UserPreferences? = null - - /** - * See [CurrentAccount.state]. - */ - var state: ProductState? = null - - /** - * See [CurrentAccount.subArrangements]. - */ - var subArrangements: List? = null - - /** - * See [CurrentAccount.financialInstitutionId]. - */ - var financialInstitutionId: Long? = null - - /** - * See [CurrentAccount.additions]. - */ - var additions: Map? = null - - /** - * See [CurrentAccount.displayName]. - */ - var displayName: String? = null - - /** - * See [CurrentAccount.cardDetails]. - */ - var cardDetails: CardDetails? = null - - /** - * See [CurrentAccount.interestDetails]. - */ - var interestDetails: InterestDetails? = null - - /** - * See [CurrentAccount.reservedAmount]. - */ - var reservedAmount: BigDecimal? = null - - /** - * See [CurrentAccount.remainingPeriodicTransfers]. - */ - var remainingPeriodicTransfers: BigDecimal? = null - - /** - * See [CurrentAccount.nextClosingDate]. - */ - var nextClosingDate: LocalDate? = null - - /** - * See [CurrentAccount.overdueSince]. - */ - var overdueSince: LocalDate? = null - - /** - * See [CurrentAccount.externalAccountStatus]. - */ - var externalAccountStatus: String? = null - - /** - * See [CurrentAccount.debitCardItems]. - */ - fun setDebitCards(debitCardItems: Set) = apply { - this.debitCardItems = debitCardItems - } - - /** - * See [CurrentAccount.bookedBalance]. - */ - fun setBookedBalance(bookedBalance: String?) = apply { - this.bookedBalance = bookedBalance - } - - /** - * See [CurrentAccount.availableBalance]. - */ - fun setAvailableBalance(availableBalance: String?) = apply { - this.availableBalance = availableBalance - } - - /** - * See [CurrentAccount.creditLimit]. - */ - fun setCreditLimit(creditLimit: String?) = apply { - this.creditLimit = creditLimit - } - - /** - * See [CurrentAccount.IBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setIBAN(IBAN: String?) = apply { - this.IBAN = IBAN - } - - /** - * See [CurrentAccount.BBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setBBAN(BBAN: String?) = apply { - this.BBAN = BBAN - } - - /** - * See [CurrentAccount.BIC]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setBIC(BIC: String?) = apply { - this.BIC = BIC - } - - /** - * See [CurrentAccount.unMaskableAttributes]. - */ - fun setUnMaskableAttributes(unMaskableAttributes: Set?) = apply { - this.unMaskableAttributes = unMaskableAttributes - } - - /** - * See [CurrentAccount.currency]. - */ - fun setCurrency(currency: String?) = apply { - this.currency = currency - } - - /** - * See [CurrentAccount.urgentTransferAllowed]. - */ - fun setUrgentTransferAllowed(urgentTransferAllowed: Boolean?) = apply { - this.urgentTransferAllowed = urgentTransferAllowed - } - - /** - * See [CurrentAccount.bankBranchCode]. - */ - fun setBankBranchCode(bankBranchCode: String?) = apply { - this.bankBranchCode = bankBranchCode - } - - /** - * See [CurrentAccount.bankBranchCode2]. - */ - fun setBankBranchCode2(bankBranchCode2: String?) = apply { - this.bankBranchCode2 = bankBranchCode2 - } - - /** - * See [CurrentAccount.accountInterestRate]. - */ - fun setAccountInterestRate(accountInterestRate: BigDecimal?) = apply { - this.accountInterestRate = accountInterestRate - } - - /** - * See [CurrentAccount.valueDateBalance]. - */ - fun setValueDateBalance(valueDateBalance: BigDecimal?) = apply { - this.valueDateBalance = valueDateBalance - } - - /** - * See [CurrentAccount.creditLimitUsage]. - */ - fun setCreditLimitUsage(creditLimitUsage: BigDecimal?) = apply { - this.creditLimitUsage = creditLimitUsage - } - - /** - * See [CurrentAccount.creditLimitInterestRate]. - */ - fun setCreditLimitInterestRate(creditLimitInterestRate: BigDecimal?) = apply { - this.creditLimitInterestRate = creditLimitInterestRate - } - - /** - * See [CurrentAccount.creditLimitExpiryDate]. - */ - fun setCreditLimitExpiryDate(creditLimitExpiryDate: OffsetDateTime?) = apply { - this.creditLimitExpiryDate = creditLimitExpiryDate - } - - /** - * See [CurrentAccount.accruedInterest]. - */ - fun setAccruedInterest(accruedInterest: BigDecimal?) = apply { - this.accruedInterest = accruedInterest - } - - /** - * See [CurrentAccount.startDate]. - */ - fun setStartDate(startDate: OffsetDateTime?) = apply { - this.startDate = startDate - } - - /** - * See [CurrentAccount.minimumRequiredBalance]. - */ - fun setMinimumRequiredBalance(minimumRequiredBalance: BigDecimal?) = apply { - this.minimumRequiredBalance = minimumRequiredBalance - } - - /** - * See [CurrentAccount.accountHolderAddressLine1]. - */ - fun setAccountHolderAddressLine1(accountHolderAddressLine1: String?) = apply { - this.accountHolderAddressLine1 = accountHolderAddressLine1 - } - - /** - * See [CurrentAccount.accountHolderAddressLine2]. - */ - fun setAccountHolderAddressLine2(accountHolderAddressLine2: String?) = apply { - this.accountHolderAddressLine2 = accountHolderAddressLine2 - } - - /** - * See [CurrentAccount.accountHolderStreetName]. - */ - fun setAccountHolderStreetName(accountHolderStreetName: String?) = apply { - this.accountHolderStreetName = accountHolderStreetName - } - - /** - * See [CurrentAccount.town]. - */ - fun setTown(town: String?) = apply { - this.town = town - } - - /** - * See [CurrentAccount.postCode]. - */ - fun setPostCode(postCode: String?) = apply { - this.postCode = postCode - } - - /** - * See [CurrentAccount.countrySubDivision]. - */ - fun setCountrySubDivision(countrySubDivision: String?) = apply { - this.countrySubDivision = countrySubDivision - } - - /** - * See [CurrentAccount.creditAccount]. - */ - fun setCreditAccount(creditAccount: Boolean?) = apply { - this.creditAccount = creditAccount - } - - /** - * See [CurrentAccount.debitAccount]. - */ - fun setDebitAccount(debitAccount: Boolean?) = apply { - this.debitAccount = debitAccount - } - - /** - * See [CurrentAccount.accountHolderNames]. - */ - fun setAccountHolderNames(accountHolderNames: String?) = apply { - this.accountHolderNames = accountHolderNames - } - - /** - * See [CurrentAccount.accountHolderCountry]. - */ - fun setAccountHolderCountry(accountHolderCountry: String?) = apply { - this.accountHolderCountry = accountHolderCountry - } - - /** - * See [CurrentAccount.id]. - */ - fun setId(id: String?) = apply { - this.id = id - } - - /** - * See [CurrentAccount.name]. - */ - fun setName(name: String?) = apply { - this.name = name - } - - /** - * See [CurrentAccount.externalTransferAllowed]. - */ - fun setExternalTransferAllowed(externalTransferAllowed: Boolean?) = apply { - this.externalTransferAllowed = externalTransferAllowed - } - - /** - * See [CurrentAccount.crossCurrencyAllowed]. - */ - fun setCrossCurrencyAllowed(crossCurrencyAllowed: Boolean?) = apply { - this.crossCurrencyAllowed = crossCurrencyAllowed - } - - /** - * See [CurrentAccount.productKindName]. - */ - fun setProductKindName(productKindName: String?) = apply { - this.productKindName = productKindName - } - - /** - * See [CurrentAccount.productTypeName]. - */ - fun setProductTypeName(productTypeName: String?) = apply { - this.productTypeName = productTypeName - } - - /** - * See [CurrentAccount.bankAlias]. - */ - fun setBankAlias(bankAlias: String?) = apply { - this.bankAlias = bankAlias - } - - /** - * See [CurrentAccount.sourceId]. - */ - fun setSourceId(sourceId: String?) = apply { - this.sourceId = sourceId - } - - /** - * See [CurrentAccount.accountOpeningDate]. - */ - fun setAccountOpeningDate(accountOpeningDate: OffsetDateTime?) = apply { - this.accountOpeningDate = accountOpeningDate - } - - /** - * See [CurrentAccount.lastUpdateDate]. - */ - fun setLastUpdateDate(lastUpdateDate: OffsetDateTime?) = apply { - this.lastUpdateDate = lastUpdateDate - } - - /** - * See [CurrentAccount.lastSyncDate]. - */ - fun setLastSyncDate(lastSyncDate: OffsetDateTime?) = apply { - this.lastSyncDate = lastSyncDate - } - - /** - * See [CurrentAccount.parentId]. - */ - fun setParentId(parentId: String?) = apply { - this.parentId = parentId - } - - /** - * See [CurrentAccount.userPreferences]. - */ - fun setUserPreferences(userPreferences: UserPreferences?) = apply { - this.userPreferences = userPreferences - } - - /** - * See [CurrentAccount.state]. - */ - fun setState(state: ProductState?) = apply { - this.state = state - } - - /** - * See [CurrentAccount.subArrangements]. - */ - fun setSubArrangements(subArrangements: List?) = apply { - this.subArrangements = subArrangements - } - - /** - * See [CurrentAccount.financialInstitutionId]. - */ - fun setFinancialInstitutionId(financialInstitutionId: Long?) = apply { - this.financialInstitutionId = financialInstitutionId - } - - /** - * See [CurrentAccount.additions]. - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * See [CurrentAccount.displayName]. - */ - fun setDisplayName(displayName: String?) = apply { - this.displayName = displayName - } - - /** - * See [CurrentAccount.cardDetails]. - */ - fun setCardDetails(cardDetails: CardDetails?) = - apply { this.cardDetails = cardDetails } - - /** - * See [CurrentAccount.reservedAmount]. - */ - fun setReservedAmount(reservedAmount: BigDecimal?) = - apply { this.reservedAmount = reservedAmount } - - /** - * See [CurrentAccount.remainingPeriodicTransfers]. - */ - fun setRemainingPeriodicTransfers(remainingPeriodicTransfers: BigDecimal?) = - apply { this.remainingPeriodicTransfers = remainingPeriodicTransfers } - - /** - * See [CurrentAccount.nextClosingDate]. - */ - fun setNextClosingDate(nextClosingDate: LocalDate?) = - apply { this.nextClosingDate = nextClosingDate } - - /** - * See [CurrentAccount.overdueSince]. - */ - fun setOverdueSince(overdueSince: LocalDate?) = - apply { this.overdueSince = overdueSince } - - /** - * See [CurrentAccount.externalAccountStatus]. - */ - fun setExternalAccountStatus(externalAccountStatus: String?) = - apply { this.externalAccountStatus = externalAccountStatus } - - /** - * See [CurrentAccount.interestDetails]. - */ - fun setInterestDetails(interestDetails: InterestDetails?) = - apply { this.interestDetails = interestDetails } - - /** - * Builds an instance of [CurrentAccount] - */ - fun build() = CurrentAccount( - debitCardItems = requireNotNull(debitCardItems), - bookedBalance = bookedBalance, - availableBalance = availableBalance, - creditLimit = creditLimit, - IBAN = IBAN, - BBAN = BBAN, - BIC = BIC, - unMaskableAttributes = unMaskableAttributes, - currency = currency, - urgentTransferAllowed = urgentTransferAllowed, - bankBranchCode = bankBranchCode, - bankBranchCode2 = bankBranchCode2, - accountInterestRate = accountInterestRate, - valueDateBalance = valueDateBalance, - creditLimitUsage = creditLimitUsage, - creditLimitInterestRate = creditLimitInterestRate, - creditLimitExpiryDate = creditLimitExpiryDate, - accruedInterest = accruedInterest, - accountHolderNames = accountHolderNames, - startDate = startDate, - minimumRequiredBalance = minimumRequiredBalance, - accountHolderAddressLine1 = accountHolderAddressLine1, - accountHolderAddressLine2 = accountHolderAddressLine2, - accountHolderStreetName = accountHolderStreetName, - town = town, - postCode = postCode, - countrySubDivision = countrySubDivision, - creditAccount = creditAccount, - debitAccount = debitAccount, - accountHolderCountry = accountHolderCountry, - id = id, - name = name, - externalTransferAllowed = externalTransferAllowed, - crossCurrencyAllowed = crossCurrencyAllowed, - productKindName = productKindName, - productTypeName = productTypeName, - bankAlias = bankAlias, - sourceId = sourceId, - accountOpeningDate = accountOpeningDate, - lastUpdateDate = lastUpdateDate, - userPreferences = userPreferences, - state = state, - parentId = parentId, - subArrangements = subArrangements, - financialInstitutionId = financialInstitutionId, - lastSyncDate = lastSyncDate, - additions = additions, - displayName = displayName, - cardDetails = cardDetails, - interestDetails = interestDetails, - reservedAmount = reservedAmount, - remainingPeriodicTransfers = remainingPeriodicTransfers, - nextClosingDate = nextClosingDate, - overdueSince = overdueSince, - externalAccountStatus = externalAccountStatus, - ) - } -} - -/** - * DSL to create [CurrentAccount] - */ -fun CurrentAccount(block: CurrentAccount.Builder.() -> Unit) = CurrentAccount.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/current_accounts/CurrentAccounts.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/current_accounts/CurrentAccounts.kt deleted file mode 100644 index 760efae7..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/current_accounts/CurrentAccounts.kt +++ /dev/null @@ -1,96 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.current_accounts - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.common.AggregatedBalance -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param products List of current accounts. - * @param name The label/name that is used for the respective product kind. - * @param aggregatedBalance The aggregated balance of this group of products. - * @param additions Extra parameters - */ -@Poko -@Parcelize -class CurrentAccounts private constructor( - val products: List, - val name: String?, - val aggregatedBalance: AggregatedBalance?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [CurrentAccounts.products] - */ - var products: List? = null - - /** - * See [CurrentAccounts.name] - */ - var name: String? = null - - /** - * See [CurrentAccounts.aggregatedBalance] - */ - var aggregatedBalance: AggregatedBalance? = null - - /** - * See [CurrentAccounts.additions] - */ - var additions: Map? = null - - /** - * See [CurrentAccounts.products] - */ - fun setProducts(products: List) = apply { - this.products = products - } - - /** - * See [CurrentAccounts.name] - */ - fun setName(name: String?) = apply { - this.name = name - } - - /** - * See [CurrentAccounts.aggregatedBalance] - */ - fun setAggregatedBalance(aggregatedBalance: AggregatedBalance?) = apply { - this.aggregatedBalance = aggregatedBalance - } - - /** - * See [CurrentAccounts.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Builds an instance of [CurrentAccounts] - */ - fun build() = CurrentAccounts( - requireNotNull(products), - name, - aggregatedBalance, - additions - ) - } -} - -/** - * DSL to create [CurrentAccounts] - */ -fun CurrentAccounts(block: CurrentAccounts.Builder.() -> Unit) = CurrentAccounts.Builder().apply(block).build() - -internal fun CurrentAccounts?.allProducts(): List = this?.products ?: emptyList() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/custom_products/CustomProducts.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/custom_products/CustomProducts.kt deleted file mode 100644 index 80b1179d..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/custom_products/CustomProducts.kt +++ /dev/null @@ -1,111 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.custom_products - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.common.AggregatedBalance -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param products A list of custom products. - * @param name The label/name that is used for this particular group of custom products. - * @param id The id of this group of custom products. - * @param aggregatedBalance The aggregated balance of this group of products. - * @param additions Extra information. - */ -@Poko -@Parcelize -class CustomProducts private constructor( - val products: List, - val name: String?, - val id: Int?, - val aggregatedBalance: AggregatedBalance?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - - /** - * See [CustomProducts.products] - */ - var products: List? = null - - /** - * See [CustomProducts.name] - */ - var name: String? = null - - /** - * See [CustomProducts.id] - */ - var id: Int? = null - - /** - * See [CustomProducts.aggregatedBalance] - */ - var aggregatedBalance: AggregatedBalance? = null - - /** - * See [CustomProducts.additions] - */ - var additions: Map? = null - - /** - * See [CustomProducts.products] - */ - fun setProducts(products: List) = apply { - this.products = products - } - - /** - * See [CustomProducts.name] - */ - fun setName(name: String?) = apply { - this.name = name - } - - /** - * See [CustomProducts.id] - */ - fun setId(id: Int?) = apply { - this.id = id - } - - /** - * See [CustomProducts.aggregatedBalance] - */ - fun setAggregatedBalance(aggregatedBalance: AggregatedBalance?) = apply { - this.aggregatedBalance = aggregatedBalance - } - - /** - * See [CustomProducts.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Builds an instance of [CustomProducts] - */ - fun build() = CustomProducts( - requireNotNull(products), - name, - id, - aggregatedBalance, - additions - ) - } -} - -/** - * DSL to create [CustomProducts] - */ -fun CustomProducts(block: CustomProducts.Builder.() -> Unit) = - CustomProducts.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/custom_products/GeneralAccount.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/custom_products/GeneralAccount.kt deleted file mode 100644 index d472fbeb..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/custom_products/GeneralAccount.kt +++ /dev/null @@ -1,1216 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.custom_products - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import com.backbase.accounts_journey.domain.model.common.BaseProduct -import com.backbase.accounts_journey.domain.model.common.CardDetails -import com.backbase.accounts_journey.domain.model.common.DebitCardItem -import com.backbase.accounts_journey.domain.model.common.InterestDetails -import com.backbase.accounts_journey.domain.model.common.ProductState -import com.backbase.accounts_journey.domain.model.common.TimeUnit -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal -import java.time.LocalDate -import java.time.OffsetDateTime - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param debitCardItems A list of debit cards associated with this product. - * @param bookedBalance - * @param availableBalance - * @param creditLimit - * @param IBAN The International Bank Account Number. If specified, it must be a valid IBAN, otherwise an invalid value error could be raised. - * @param BBAN Specifying the BBAN of the account - BBAN is short for Basic Bank Account Number. It represents a country-specific bank account number. - * @param BIC Bank Identifier Code - international bank code that identifies particular banks worldwide - * @param unMaskableAttributes An optional list of the maskable attributes that can be unmasked. - * @param currency The alpha-3 code (complying with ISO 4217) of the currency that qualifies the amount. - * @param urgentTransferAllowed Defines if urgent transfer is allowed. - * @param bankBranchCode (This is to accomodate additional country specific fields like Sort Code in UK) - * @param bankBranchCode2 (This is to accomodate additional country specific fields fedwire Routing Nmber) - * @param accountInterestRate The annualized cost of credit or debt-capital computed as the percentage ratio of interest to the principal. - * @param valueDateBalance The balance of the account on a specific date that needs to be used for the calculation of interest. NB! If no date is specified (like for the book date balance) the current date can be assumed. - * @param creditLimitUsage Monetary amount of the used overdraft. - * @param creditLimitInterestRate Overdraft Interest is an interest applied to the account for any time throughout the month when the account is overdrawn. - * @param creditLimitExpiryDate The date after which overdraft will no longer be available to the account (renewed automatically or cancelled). - * @param accruedInterest - * @param startDate - * @param minimumRequiredBalance Minimum amount that a customer must have in an account in order to receive some sort of service, such as keeping the account open or receive interest. - * @param accountHolderAddressLine1 Address of the Payer/Payee - Alternate address line for the account. - * @param accountHolderAddressLine2 Address of the Payer/Payee - Alternate address line for the account. - * @param accountHolderStreetName Street name of the Payer/Payee - Alternate street name for the account. - * @param town Town of the Payer/Payee - Alternate town for the account. - * @param postCode The postcode of the account holder address. - * @param countrySubDivision The country sub division, if any. - * @param accountHolderNames Party(s) with a relationship to the account. - * @param accountHolderCountry Country of the account holder - * @param number First 6 and/or last 4 digits of a Payment card. All other digits will/to be masked. Be aware that using card number differently is potential PCI risk. - * @param cardNumber The number of the card, if any. - * @param creditCardAccountNumber The number of the account the credit card transactions settle on (so actually the reference to the settlement account of the card)? - * @param validThru Expiration date of a credit card, after which is no longer valid. - * @param applicableInterestRate The interest rate or rates which would be used for a particular arrangement. - * @param remainingCredit - * @param outstandingPayment - * @param minimumPayment The minimum payment set a percentage of balance, or a fixed cash amount. - * @param minimumPaymentDueDate Minimum Payment Due Date shown on your monthly statement to remain in good standing. - * @param currentInvestmentValue - * @param productNumber The number identifying the contract. - * @param principalAmount - * @param termUnit - * @param termNumber The number of times interest rate is paid on the settlement account. - * @param outstandingPrincipalAmount This IS the value date balance of the arrangement. - * @param monthlyInstalmentAmount A fixed payment amount paid by a borrower to the bank at a specified date each calendar month. - * @param amountInArrear The part of a debt that is overdue after missing one or more required payments. The amount of the arrears is the amount accrued from the date on which the first missed payment was due. - * @param interestSettlementAccount Account that provides quick access to accumulated cash to facilitate daily settlements with other businesses. - * @param maturityDate End term of a holding period. - * @param maturityAmount Amount payable at the end of a holding period of a product (maturity date). For deposit all of the interest is usualy paid at maturity date (IF the term is shorter then one year). - * @param autoRenewalIndicator Indicates whether or not an arrangement is to be continued after maturity automatically. Usually the product is renewed using the same principal and term unless renegotiation has taken place prior to expiration. - * @param interestPaymentFrequencyUnit - * @param interestPaymentFrequencyNumber - * @param creditAccount Indicator whether or not the arrangement can be used in payment orders as credit account. - * @param debitAccount Indicator whether or not the arrangement can be used in payment orders as debit account. - * @param id Reference to the product of which the arrangement is an instantiation. - * @param name The name of this particular product. - * @param externalTransferAllowed Defines if transfer to another party is allowed. - * @param crossCurrencyAllowed Defines if cross currency transfer is allowed - * @param productKindName The label/name that is used for the respective product kind - * @param productTypeName The label/name that is used to label a specific product type - * @param bankAlias The name that can be assigned by the bank to label the arrangement. - * @param sourceId Indicate if the account is regular or external - * @param accountOpeningDate - * @param lastUpdateDate Last date of parameter update for the arrangement. - * @param userPreferences The preferences configured by the user. - * @param state - * @param parentId Reference to the parent of the arrangement. - * @param subArrangements A list of arrangements whose parent is this product. - * @param financialInstitutionId Financial institution ID - * @param lastSyncDate Last synchronization datetime - * @param additions Extra information. - * @param displayName name of the particular product - * @param cardDetails - * @param interestDetails - * @param reservedAmount The reservation of a portion of a credit or debit balance for the cost of services not yet rendered. - * @param remainingPeriodicTransfers The limitation in periodic saving transfers or withdrawals. In the case of the US, Regulation D enables for a maximum of 6 monthly savings transfers or withdrawals. - * @param nextClosingDate The last day of the forthcoming billing cycle. - * @param overdueSince The date in which the arrangement has been overdue since. - * @param externalAccountStatus Synchronization statuses an account can have on the provider side after it has been aggregated. - */ -@Suppress("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class GeneralAccount internal constructor( - val debitCardItems: Set, - val bookedBalance: String?, - val availableBalance: String?, - val creditLimit: String?, - @SuppressWarnings("ConstructorParameterNaming") val IBAN: String?, - @SuppressWarnings("ConstructorParameterNaming") val BBAN: String?, - @SuppressWarnings("ConstructorParameterNaming") val BIC: String?, - val unMaskableAttributes: Set?, - val currency: String?, - val urgentTransferAllowed: Boolean?, - val bankBranchCode: String?, - val bankBranchCode2: String?, - val accountInterestRate: BigDecimal?, - val valueDateBalance: BigDecimal?, - val creditLimitUsage: BigDecimal?, - val creditLimitInterestRate: BigDecimal?, - val creditLimitExpiryDate: OffsetDateTime?, - val accruedInterest: BigDecimal?, - val startDate: OffsetDateTime?, - val minimumRequiredBalance: BigDecimal?, - val accountHolderAddressLine1: String?, - val accountHolderAddressLine2: String?, - val accountHolderStreetName: String?, - val town: String?, - val postCode: String?, - val countrySubDivision: String?, - val accountHolderNames: String?, - val accountHolderCountry: String?, - val number: String?, - val cardNumber: BigDecimal?, - val creditCardAccountNumber: String?, - val validThru: OffsetDateTime?, - val applicableInterestRate: BigDecimal?, - val remainingCredit: BigDecimal?, - val outstandingPayment: BigDecimal?, - val minimumPayment: BigDecimal?, - val minimumPaymentDueDate: OffsetDateTime?, - val currentInvestmentValue: String?, - val productNumber: String?, - val principalAmount: BigDecimal?, - val termUnit: TimeUnit?, - val termNumber: BigDecimal?, - val outstandingPrincipalAmount: BigDecimal?, - val monthlyInstalmentAmount: BigDecimal?, - val amountInArrear: BigDecimal?, - val interestSettlementAccount: String?, - val maturityDate: OffsetDateTime?, - val maturityAmount: BigDecimal?, - val autoRenewalIndicator: Boolean?, - val interestPaymentFrequencyUnit: TimeUnit?, - val interestPaymentFrequencyNumber: BigDecimal?, - val creditAccount: Boolean?, - val debitAccount: Boolean?, - val id: String?, - val name: String?, - val externalTransferAllowed: Boolean?, - val crossCurrencyAllowed: Boolean?, - val productKindName: String?, - val productTypeName: String?, - val bankAlias: String?, - val sourceId: String?, - val accountOpeningDate: OffsetDateTime?, - val lastUpdateDate: OffsetDateTime?, - val userPreferences: UserPreferences?, - val state: ProductState?, - val parentId: String?, - val subArrangements: List?, - val financialInstitutionId: Long?, - val lastSyncDate: OffsetDateTime?, - val additions: Map?, - val displayName: String?, - val cardDetails: CardDetails?, - val interestDetails: InterestDetails?, - val reservedAmount: BigDecimal?, - val remainingPeriodicTransfers: BigDecimal?, - val nextClosingDate: LocalDate?, - val overdueSince: LocalDate?, - val externalAccountStatus: String?, -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - - /** - * See [GeneralAccount.debitCardItems]. - */ - var debitCardItems: Set? = null - - /** - * See [GeneralAccount.bookedBalance]. - */ - var bookedBalance: String? = null - - /** - * See [GeneralAccount.availableBalance]. - */ - var availableBalance: String? = null - - /** - * See [GeneralAccount.creditLimit]. - */ - var creditLimit: String? = null - - /** - * See [GeneralAccount.IBAN]. - */ - @SuppressWarnings("VariableNaming") - var IBAN: String? = null - - /** - * See [GeneralAccount.BBAN]. - */ - @SuppressWarnings("VariableNaming") - var BBAN: String? = null - - /** - * See [GeneralAccount.BIC]. - */ - @SuppressWarnings("VariableNaming") - var BIC: String? = null - - /** - * See [GeneralAccount.unMaskableAttributes]. - */ - var unMaskableAttributes: Set? = null - - /** - * See [GeneralAccount.currency]. - */ - var currency: String? = null - - /** - * See [GeneralAccount.urgentTransferAllowed]. - */ - var urgentTransferAllowed: Boolean? = null - - /** - * See [GeneralAccount.bankBranchCode]. - */ - var bankBranchCode: String? = null - - /** - * See [GeneralAccount.bankBranchCode2]. - */ - var bankBranchCode2: String? = null - - /** - * See [GeneralAccount.accountInterestRate]. - */ - var accountInterestRate: BigDecimal? = null - - /** - * See [GeneralAccount.valueDateBalance]. - */ - var valueDateBalance: BigDecimal? = null - - /** - * See [GeneralAccount.creditLimitUsage]. - */ - - var creditLimitUsage: BigDecimal? = null - - /** - * See [GeneralAccount.creditLimitInterestRate]. - */ - var creditLimitInterestRate: BigDecimal? = null - - /** - * See [GeneralAccount.creditLimitExpiryDate]. - */ - var creditLimitExpiryDate: OffsetDateTime? = null - - /** - * See [GeneralAccount.accruedInterest]. - */ - var accruedInterest: BigDecimal? = null - - /** - * See [GeneralAccount.startDate]. - */ - var startDate: OffsetDateTime? = null - - /** - * See [GeneralAccount.minimumRequiredBalance]. - */ - var minimumRequiredBalance: BigDecimal? = null - - /** - * See [GeneralAccount.accountHolderAddressLine1]. - */ - var accountHolderAddressLine1: String? = null - - /** - * See [GeneralAccount.accountHolderAddressLine2]. - */ - var accountHolderAddressLine2: String? = null - - /** - * See [GeneralAccount.accountHolderStreetName]. - */ - var accountHolderStreetName: String? = null - - /** - * See [GeneralAccount.town]. - */ - var town: String? = null - - /** - * See [GeneralAccount.postCode]. - */ - var postCode: String? = null - - /** - * See [GeneralAccount.countrySubDivision]. - */ - var countrySubDivision: String? = null - - /** - * See [GeneralAccount.accountHolderNames]. - */ - var accountHolderNames: String? = null - - /** - * See [GeneralAccount.accountHolderCountry]. - */ - var accountHolderCountry: String? = null - - /** - * See [GeneralAccount.number]. - */ - var number: String? = null - - /** - * See [GeneralAccount.cardNumber]. - */ - var cardNumber: BigDecimal? = null - - /** - * See [GeneralAccount.creditCardAccountNumber]. - */ - var creditCardAccountNumber: String? = null - - /** - * See [GeneralAccount.validThru]. - */ - var validThru: OffsetDateTime? = null - - /** - * See [GeneralAccount.applicableInterestRate]. - */ - var applicableInterestRate: BigDecimal? = null - - /** - * See [GeneralAccount.remainingCredit]. - */ - var remainingCredit: BigDecimal? = null - - /** - * See [GeneralAccount.outstandingPayment]. - */ - var outstandingPayment: BigDecimal? = null - - /** - * See [GeneralAccount.minimumPayment]. - */ - var minimumPayment: BigDecimal? = null - - /** - * See [GeneralAccount.minimumPaymentDueDate]. - */ - var minimumPaymentDueDate: OffsetDateTime? = null - - /** - * See [GeneralAccount.currentInvestmentValue]. - */ - var currentInvestmentValue: String? = null - - /** - * See [GeneralAccount.productNumber]. - */ - var productNumber: String? = null - - /** - * See [GeneralAccount.interestSettlementAccount]. - */ - var interestSettlementAccount: String? = null - - /** - * See [GeneralAccount.principalAmount]. - */ - var principalAmount: BigDecimal? = null - - /** - * See [GeneralAccount.termNumber]. - */ - var termNumber: BigDecimal? = null - - /** - * See [GeneralAccount.outstandingPrincipalAmount]. - */ - var outstandingPrincipalAmount: BigDecimal? = null - - /** - * See [GeneralAccount.monthlyInstalmentAmount]. - */ - var monthlyInstalmentAmount: BigDecimal? = null - - /** - * See [GeneralAccount.amountInArrear]. - */ - var amountInArrear: BigDecimal? = null - - /** - * See [GeneralAccount.maturityAmount]. - */ - var maturityAmount: BigDecimal? = null - - /** - * See [GeneralAccount.termUnit]. - */ - var termUnit: TimeUnit? = null - - /** - * See [GeneralAccount.interestPaymentFrequencyUnit]. - */ - var interestPaymentFrequencyUnit: TimeUnit? = null - - /** - * See [GeneralAccount.autoRenewalIndicator]. - */ - var autoRenewalIndicator: Boolean? = null - - /** - * See [GeneralAccount.creditAccount]. - */ - var creditAccount: Boolean? = null - - /** - * See [GeneralAccount.debitAccount]. - */ - var debitAccount: Boolean? = null - - /** - * See [GeneralAccount.externalTransferAllowed]. - */ - var externalTransferAllowed: Boolean? = null - - /** - * See [GeneralAccount.crossCurrencyAllowed]. - */ - var crossCurrencyAllowed: Boolean? = null - - /** - * See [GeneralAccount.id]. - */ - var id: String? = null - - /** - * See [GeneralAccount.name]. - */ - var name: String? = null - - /** - * See [GeneralAccount.productKindName]. - */ - var productKindName: String? = null - - /** - * See [GeneralAccount.productTypeName]. - */ - var productTypeName: String? = null - - /** - * See [GeneralAccount.bankAlias]. - */ - var bankAlias: String? = null - - /** - * See [GeneralAccount.sourceId]. - */ - var sourceId: String? = null - - /** - * See [GeneralAccount.parentId]. - */ - var parentId: String? = null - - /** - * See [GeneralAccount.subArrangements]. - */ - var subArrangements: List? = null - - /** - * See [GeneralAccount.maturityDate]. - */ - var maturityDate: OffsetDateTime? = null - - /** - * See [GeneralAccount.accountOpeningDate]. - */ - var accountOpeningDate: OffsetDateTime? = null - - /** - * See [GeneralAccount.lastUpdateDate]. - */ - var lastUpdateDate: OffsetDateTime? = null - - /** - * See [GeneralAccount.lastSyncDate]. - */ - var lastSyncDate: OffsetDateTime? = null - - /** - * See [GeneralAccount.interestPaymentFrequencyNumber]. - */ - var interestPaymentFrequencyNumber: BigDecimal? = null - - /** - * See [GeneralAccount.userPreferences]. - */ - var userPreferences: UserPreferences? = null - - /** - * See [GeneralAccount.state]. - */ - var state: ProductState? = null - - /** - * See [GeneralAccount.financialInstitutionId]. - */ - var financialInstitutionId: Long? = null - - /** - * See [GeneralAccount.additions]. - */ - var additions: Map? = null - - /** - * See [GeneralAccount.displayName]. - */ - var displayName: String? = null - - /** - * See [GeneralAccount.cardDetails]. - */ - var cardDetails: CardDetails? = null - - /** - * See [GeneralAccount.interestDetails]. - */ - var interestDetails: InterestDetails? = null - - /** - * See [GeneralAccount.reservedAmount]. - */ - var reservedAmount: BigDecimal? = null - - /** - * See [GeneralAccount.remainingPeriodicTransfers]. - */ - var remainingPeriodicTransfers: BigDecimal? = null - - /** - * See [GeneralAccount.nextClosingDate]. - */ - var nextClosingDate: LocalDate? = null - - /** - * See [GeneralAccount.overdueSince]. - */ - var overdueSince: LocalDate? = null - - /** - * See [GeneralAccount.externalAccountStatus]. - */ - var externalAccountStatus: String? = null - - /** - * See [GeneralAccount.debitCardItems]. - */ - fun setDebitCards(debitCardItems: Set) = apply { - this.debitCardItems = debitCardItems - } - - /** - * See [GeneralAccount.bookedBalance]. - */ - fun setBookedBalance(bookedBalance: String?) = apply { - this.bookedBalance = bookedBalance - } - - /** - * See [GeneralAccount.availableBalance]. - */ - fun setAvailableBalance(availableBalance: String?) = apply { - this.availableBalance = availableBalance - } - - /** - * See [GeneralAccount.creditLimit]. - */ - fun setCreditLimit(creditLimit: String?) = apply { - this.creditLimit = creditLimit - } - - /** - * See [GeneralAccount.IBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setIBAN(IBAN: String?) = apply { - this.IBAN = IBAN - } - - /** - * See [GeneralAccount.BBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setBBAN(BBAN: String?) = apply { - this.BBAN = BBAN - } - - /** - * See [GeneralAccount.BIC]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setBIC(BIC: String?) = apply { - this.BIC = BIC - } - - /** - * See [GeneralAccount.unMaskableAttributes]. - */ - fun setUnMaskableAttributes(unMaskableAttributes: Set?) = - apply { this.unMaskableAttributes = unMaskableAttributes } - - /** - * See [GeneralAccount.currency]. - */ - fun setCurrency(currency: String?) = apply { - this.currency = currency - } - - /** - * See [GeneralAccount.urgentTransferAllowed]. - */ - fun setUrgentTransferAllowed(urgentTransferAllowed: Boolean?) = apply { - this.urgentTransferAllowed = urgentTransferAllowed - } - - /** - * See [GeneralAccount.bankBranchCode]. - */ - fun setBankBranchCode(bankBranchCode: String?) = apply { - this.bankBranchCode = bankBranchCode - } - - /** - * See [GeneralAccount.bankBranchCode2]. - */ - fun setBankBranchCode2(bankBranchCode2: String?) = apply { - this.bankBranchCode2 = bankBranchCode2 - } - - /** - * See [GeneralAccount.accountInterestRate]. - */ - fun setAccountInterestRate(accountInterestRate: BigDecimal?) = apply { - this.accountInterestRate = accountInterestRate - } - - /** - * See [GeneralAccount.valueDateBalance]. - */ - fun setValueDateBalance(valueDateBalance: BigDecimal?) = apply { - this.valueDateBalance = valueDateBalance - } - - /** - * See [GeneralAccount.creditLimitUsage]. - */ - fun setCreditLimitUsage(creditLimitUsage: BigDecimal?) = apply { - this.creditLimitUsage = creditLimitUsage - } - - /** - * See [GeneralAccount.creditLimitInterestRate]. - */ - fun setCreditLimitInterestRate(creditLimitInterestRate: BigDecimal?) = apply { - this.creditLimitInterestRate = creditLimitInterestRate - } - - /** - * See [GeneralAccount.creditLimitExpiryDate]. - */ - fun setCreditLimitExpiryDate(creditLimitExpiryDate: OffsetDateTime?) = apply { - this.creditLimitExpiryDate = creditLimitExpiryDate - } - - /** - * See [GeneralAccount.accruedInterest]. - */ - fun setAccruedInterest(accruedInterest: BigDecimal?) = apply { - this.accruedInterest = accruedInterest - } - - /** - * See [GeneralAccount.startDate]. - */ - fun setStartDate(startDate: OffsetDateTime?) = apply { - this.startDate = startDate - } - - /** - * See [GeneralAccount.minimumRequiredBalance]. - */ - fun setMinimumRequiredBalance(minimumRequiredBalance: BigDecimal?) = apply { - this.minimumRequiredBalance = minimumRequiredBalance - } - - /** - * See [GeneralAccount.accountHolderAddressLine1]. - */ - fun setAccountHolderAddressLine1(accountHolderAddressLine1: String?) = apply { - this.accountHolderAddressLine1 = accountHolderAddressLine1 - } - - /** - * See [GeneralAccount.accountHolderAddressLine2]. - */ - fun setAccountHolderAddressLine2(accountHolderAddressLine2: String?) = apply { - this.accountHolderAddressLine2 = accountHolderAddressLine2 - } - - /** - * See [GeneralAccount.accountHolderStreetName]. - */ - fun setAccountHolderStreetName(accountHolderStreetName: String?) = apply { - this.accountHolderStreetName = accountHolderStreetName - } - - /** - * See [GeneralAccount.town]. - */ - fun setTown(town: String?) = apply { - this.town = town - } - - /** - * See [GeneralAccount.postCode]. - */ - fun setPostCode(postCode: String?) = apply { - this.postCode = postCode - } - - /** - * See [GeneralAccount.countrySubDivision]. - */ - fun setCountrySubDivision(countrySubDivision: String?) = apply { - this.countrySubDivision = countrySubDivision - } - - /** - * See [GeneralAccount.accountHolderNames]. - */ - fun setAccountHolderNames(accountHolderNames: String?) = apply { - this.accountHolderNames = accountHolderNames - } - - /** - * See [GeneralAccount.accountHolderCountry]. - */ - fun setAccountHolderCountry(accountHolderCountry: String?) = apply { - this.accountHolderCountry = accountHolderCountry - } - - /** - * See [GeneralAccount.number]. - */ - fun setNumber(number: String?) = apply { - this.number = number - } - - /** - * See [GeneralAccount.cardNumber]. - */ - fun setCardNumber(cardNumber: BigDecimal?) = apply { - this.cardNumber = cardNumber - } - - /** - * See [GeneralAccount.creditCardAccountNumber]. - */ - fun setCreditCardAccountNumber(creditCardAccountNumber: String?) = apply { - this.creditCardAccountNumber = creditCardAccountNumber - } - - /** - * See [GeneralAccount.validThru]. - */ - fun setValidThru(validThru: OffsetDateTime?) = apply { - this.validThru = validThru - } - - /** - * See [GeneralAccount.minimumPaymentDueDate]. - */ - fun setMinimumPaymentDueDate(minimumPaymentDueDate: OffsetDateTime?) = apply { - this.minimumPaymentDueDate = minimumPaymentDueDate - } - - /** - * See [GeneralAccount.maturityDate]. - */ - fun setMaturityDate(maturityDate: OffsetDateTime?) = apply { - this.maturityDate = maturityDate - } - - /** - * See [GeneralAccount.accountOpeningDate]. - */ - fun setAccountOpeningDate(accountOpeningDate: OffsetDateTime?) = apply { - this.accountOpeningDate = accountOpeningDate - } - - /** - * See [GeneralAccount.lastUpdateDate]. - */ - fun setLastUpdateDate(lastUpdateDate: OffsetDateTime?) = apply { - this.lastUpdateDate = lastUpdateDate - } - - /** - * See [GeneralAccount.lastSyncDate]. - */ - fun setLastSyncDate(lastSyncDate: OffsetDateTime?) = apply { - this.lastSyncDate = lastSyncDate - } - - /** - * See [GeneralAccount.applicableInterestRate]. - */ - fun setApplicableInterestRate(applicableInterestRate: BigDecimal?) = apply { - this.applicableInterestRate = applicableInterestRate - } - - /** - * See [GeneralAccount.remainingCredit]. - */ - fun setRemainingCredit(remainingCredit: BigDecimal?) = apply { - this.remainingCredit = remainingCredit - } - - /** - * See [GeneralAccount.outstandingPayment]. - */ - fun setOutstandingPayment(outstandingPayment: BigDecimal?) = apply { - this.outstandingPayment = outstandingPayment - } - - /** - * See [GeneralAccount.minimumPayment]. - */ - fun setMinimumPayment(minimumPayment: BigDecimal?) = apply { - this.minimumPayment = minimumPayment - } - - /** - * See [GeneralAccount.principalAmount]. - */ - fun setPrincipalAmount(principalAmount: BigDecimal?) = apply { - this.principalAmount = principalAmount - } - - /** - * See [GeneralAccount.termNumber]. - */ - fun setTermNumber(termNumber: BigDecimal?) = apply { - this.termNumber = termNumber - } - - /** - * See [GeneralAccount.outstandingPrincipalAmount]. - */ - fun setOutstandingPrincipalAmount(outstandingPrincipalAmount: BigDecimal?) = apply { - this.outstandingPrincipalAmount = outstandingPrincipalAmount - } - - /** - * See [GeneralAccount.monthlyInstalmentAmount]. - */ - fun setMonthlyInstalmentAmount(monthlyInstalmentAmount: BigDecimal?) = apply { - this.monthlyInstalmentAmount = monthlyInstalmentAmount - } - - /** - * See [GeneralAccount.amountInArrear]. - */ - fun setAmountInArrear(amountInArrear: BigDecimal?) = apply { - this.amountInArrear = amountInArrear - } - - /** - * See [GeneralAccount.maturityAmount]. - */ - fun setMaturityAmount(maturityAmount: BigDecimal?) = apply { - this.maturityAmount = maturityAmount - } - - /** - * See [GeneralAccount.interestPaymentFrequencyNumber]. - */ - fun setInterestPaymentFrequencyNumber(interestPaymentFrequencyNumber: BigDecimal?) = apply { - this.interestPaymentFrequencyNumber = interestPaymentFrequencyNumber - } - - /** - * See [GeneralAccount.currentInvestmentValue]. - */ - fun setCurrentInvestmentValue(currentInvestmentValue: String?) = apply { - this.currentInvestmentValue = currentInvestmentValue - } - - /** - * See [GeneralAccount.productNumber]. - */ - fun setProductNumber(productNumber: String?) = apply { - this.productNumber = productNumber - } - - /** - * See [GeneralAccount.interestSettlementAccount]. - */ - fun setInterestSettlementAccount(interestSettlementAccount: String?) = apply { - this.interestSettlementAccount = interestSettlementAccount - } - - /** - * See [GeneralAccount.id]. - */ - fun setId(id: String?) = apply { - this.id = id - } - - /** - * See [GeneralAccount.name]. - */ - fun setName(name: String?) = apply { - this.name = name - } - - /** - * See [GeneralAccount.productKindName]. - */ - fun setProductKindName(productKindName: String?) = apply { - this.productKindName = productKindName - } - - /** - * See [GeneralAccount.productTypeName]. - */ - fun setProductTypeName(productTypeName: String?) = apply { - this.productTypeName = productTypeName - } - - /** - * See [GeneralAccount.bankAlias]. - */ - fun setBankAlias(bankAlias: String?) = apply { - this.bankAlias = bankAlias - } - - /** - * See [GeneralAccount.sourceId]. - */ - fun setSourceId(sourceId: String?) = apply { - this.sourceId = sourceId - } - - /** - * See [GeneralAccount.parentId]. - */ - fun setParentId(parentId: String?) = apply { - this.parentId = parentId - } - - /** - * See [GeneralAccount.subArrangements]. - */ - fun setSubArrangements(subArrangements: List?) = apply { - this.subArrangements = subArrangements - } - - /** - * See [GeneralAccount.termUnit]. - */ - fun setTermUnit(termUnit: TimeUnit?) = apply { - this.termUnit = termUnit - } - - /** - * See [GeneralAccount.interestPaymentFrequencyUnit]. - */ - fun setInterestPaymentFrequencyUnit(interestPaymentFrequencyUnit: TimeUnit?) = apply { - this.interestPaymentFrequencyUnit = interestPaymentFrequencyUnit - } - - /** - * See [GeneralAccount.autoRenewalIndicator]. - */ - fun setAutoRenewalIndicator(autoRenewalIndicator: Boolean?) = apply { - this.autoRenewalIndicator = autoRenewalIndicator - } - - /** - * See [GeneralAccount.creditAccount]. - */ - fun setCreditAccount(creditAccount: Boolean?) = apply { - this.creditAccount = creditAccount - } - - /** - * See [GeneralAccount.debitAccount]. - */ - fun setDebitAccount(debitAccount: Boolean?) = apply { - this.debitAccount = debitAccount - } - - /** - * See [GeneralAccount.externalTransferAllowed]. - */ - fun setExternalTransferAllowed(externalTransferAllowed: Boolean?) = apply { - this.externalTransferAllowed = externalTransferAllowed - } - - /** - * See [GeneralAccount.crossCurrencyAllowed]. - */ - fun setCrossCurrencyAllowed(crossCurrencyAllowed: Boolean?) = apply { - this.crossCurrencyAllowed = crossCurrencyAllowed - } - - /** - * See [GeneralAccount.userPreferences]. - */ - fun setUserPreferences(userPreferences: UserPreferences?) = apply { - this.userPreferences = userPreferences - } - - /** - * See [GeneralAccount.state]. - */ - fun setState(state: ProductState?) = apply { - this.state = state - } - - /** - * See [GeneralAccount.financialInstitutionId]. - */ - fun setFinancialInstitutionId(financialInstitutionId: Long?) = apply { - this.financialInstitutionId = financialInstitutionId - } - - /** - * See [GeneralAccount.additions]. - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * See [GeneralAccount.displayName]. - */ - fun setDisplayName(displayName: String?) = apply { - this.displayName = displayName - } - - /** - * See [GeneralAccount.cardDetails]. - */ - fun setCardDetails(cardDetails: CardDetails?) = - apply { this.cardDetails = cardDetails } - - /** - * See [GeneralAccount.reservedAmount]. - */ - fun setReservedAmount(reservedAmount: BigDecimal?) = - apply { this.reservedAmount = reservedAmount } - - /** - * See [GeneralAccount.remainingPeriodicTransfers]. - */ - fun setRemainingPeriodicTransfers(remainingPeriodicTransfers: BigDecimal?) = - apply { this.remainingPeriodicTransfers = remainingPeriodicTransfers } - - /** - * See [GeneralAccount.nextClosingDate]. - */ - fun setNextClosingDate(nextClosingDate: LocalDate?) = - apply { this.nextClosingDate = nextClosingDate } - - /** - * See [GeneralAccount.overdueSince]. - */ - fun setOverdueSince(overdueSince: LocalDate?) = - apply { this.overdueSince = overdueSince } - - /** - * See [GeneralAccount.externalAccountStatus]. - */ - fun setExternalAccountStatus(externalAccountStatus: String?) = - apply { this.externalAccountStatus = externalAccountStatus } - - /** - * See [GeneralAccount.interestDetails]. - */ - fun setInterestDetails(interestDetails: InterestDetails?) = - apply { this.interestDetails = interestDetails } - - /** - * Builds an instance of [GeneralAccount]. - */ - @Suppress("LongMethod") - fun build() = GeneralAccount( - debitCardItems = requireNotNull(debitCardItems), - bookedBalance = bookedBalance, - availableBalance = availableBalance, - creditLimit = creditLimit, - IBAN = IBAN, - BBAN = BBAN, - BIC = BIC, - unMaskableAttributes = unMaskableAttributes, - currency = currency, - urgentTransferAllowed = urgentTransferAllowed, - bankBranchCode = bankBranchCode, - bankBranchCode2 = bankBranchCode2, - accountInterestRate = accountInterestRate, - valueDateBalance = valueDateBalance, - creditLimitUsage = creditLimitUsage, - creditLimitInterestRate = creditLimitInterestRate, - creditLimitExpiryDate = creditLimitExpiryDate, - accruedInterest = accruedInterest, - startDate = startDate, - minimumRequiredBalance = minimumRequiredBalance, - accountHolderAddressLine1 = accountHolderAddressLine1, - accountHolderAddressLine2 = accountHolderAddressLine2, - accountHolderStreetName = accountHolderStreetName, - town = town, - postCode = postCode, - countrySubDivision = countrySubDivision, - accountHolderNames = accountHolderNames, - accountHolderCountry = accountHolderCountry, - number = number, - cardNumber = cardNumber, - creditCardAccountNumber = creditCardAccountNumber, - validThru = validThru, - applicableInterestRate = applicableInterestRate, - remainingCredit = remainingCredit, - outstandingPayment = outstandingPayment, - minimumPayment = minimumPayment, - minimumPaymentDueDate = minimumPaymentDueDate, - currentInvestmentValue = currentInvestmentValue, - productNumber = productNumber, - principalAmount = principalAmount, - termUnit = termUnit, - termNumber = termNumber, - outstandingPrincipalAmount = outstandingPrincipalAmount, - monthlyInstalmentAmount = monthlyInstalmentAmount, - amountInArrear = amountInArrear, - interestSettlementAccount = interestSettlementAccount, - maturityDate = maturityDate, - maturityAmount = maturityAmount, - autoRenewalIndicator = autoRenewalIndicator, - interestPaymentFrequencyUnit = interestPaymentFrequencyUnit, - interestPaymentFrequencyNumber = interestPaymentFrequencyNumber, - creditAccount = creditAccount, - debitAccount = debitAccount, - id = id, - name = name, - externalTransferAllowed = externalTransferAllowed, - crossCurrencyAllowed = crossCurrencyAllowed, - productKindName = productKindName, - productTypeName = productTypeName, - bankAlias = bankAlias, - sourceId = sourceId, - accountOpeningDate = accountOpeningDate, - lastUpdateDate = lastUpdateDate, - userPreferences = userPreferences, - state = state, - parentId = parentId, - subArrangements = subArrangements, - financialInstitutionId = financialInstitutionId, - lastSyncDate = lastSyncDate, - additions = additions, - displayName = displayName, - cardDetails = cardDetails, - interestDetails = interestDetails, - reservedAmount = reservedAmount, - remainingPeriodicTransfers = remainingPeriodicTransfers, - nextClosingDate = nextClosingDate, - overdueSince = overdueSince, - externalAccountStatus = externalAccountStatus, - ) - } -} - -/** - * DSL to create [GeneralAccount] - */ -fun GeneralAccount(block: GeneralAccount.Builder.() -> Unit) = GeneralAccount.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/debit_card/DebitCard.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/debit_card/DebitCard.kt deleted file mode 100644 index 4b97af12..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/debit_card/DebitCard.kt +++ /dev/null @@ -1,509 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.debit_card - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import com.backbase.accounts_journey.domain.model.common.BaseProduct -import com.backbase.accounts_journey.domain.model.common.CardDetails -import com.backbase.accounts_journey.domain.model.common.DebitCardItem -import com.backbase.accounts_journey.domain.model.common.InterestDetails -import com.backbase.accounts_journey.domain.model.common.ProductState -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal -import java.time.LocalDate -import java.time.OffsetDateTime - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param debitCardsItems - * @param number First 6 and/or last 4 digits of a Payment card. All other digits will/to be masked. Be aware that using card number differently is potential PCI risk. - * @param urgentTransferAllowed Defines if urgent transfer is allowed. - * @param cardNumber - * @param accountInterestRate The annualized cost of credit or debt-capital computed as the percentage ratio of interest to the principal. - * @param accountHolderNames Party(s) with a relationship to the account. - * @param startDate - * @param validThru Expiration date of a credit card, after which is no longer valid. - * @param id Reference to the product of which the arrangement is an instantiation. - * @param name - * @param externalTransferAllowed Defines if transfer to another party is allowed. - * @param crossCurrencyAllowed Defines if cross currency transfer is allowed - * @param productKindName The label/name that is used for the respective product kind - * @param productTypeName The label/name that is used to label a specific product type - * @param bankAlias The name that can be assigned by the bank to label the arrangement. - * @param sourceId Indicate if the account is regular or external - * @param accountOpeningDate - * @param lastUpdateDate Last date of parameter update for the arrangement. - * @param userPreferences The preferences configured by the user. - * @param subArrangements A list of arrangements whose parent is this product. - * @param state - * @param parentId Reference to the parent of the arrangement. - * @param financialInstitutionId Financial institution ID - * @param lastSyncDate Last synchronization datetime - * @param unMaskableAttributes An optional list of the maskable attributes that can be unmasked. - * @param additions Extra parameters - * @param displayName name of the particular product - * @param cardDetails - * @param interestDetails - * @param reservedAmount The reservation of a portion of a credit or debit balance for the cost of services not yet rendered. - * @param remainingPeriodicTransfers The limitation in periodic saving transfers or withdrawals. In the case of the US, Regulation D enables for a maximum of 6 monthly savings transfers or withdrawals. - * @param nextClosingDate The last day of the forthcoming billing cycle. - * @param overdueSince The date in which the arrangement has been overdue since. - * @param externalAccountStatus Synchronization statuses an account can have on the provider side after it has been aggregated. - */ -@Suppress("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class DebitCard internal constructor( - val debitCardsItems: Set, - val number: String?, - val urgentTransferAllowed: Boolean?, - val cardNumber: BigDecimal?, - val accountInterestRate: BigDecimal?, - val accountHolderNames: String?, - val startDate: OffsetDateTime?, - val validThru: OffsetDateTime?, - val id: String?, - val name: String?, - val externalTransferAllowed: Boolean?, - val crossCurrencyAllowed: Boolean?, - val productKindName: String?, - val productTypeName: String?, - val bankAlias: String?, - val sourceId: String?, - val accountOpeningDate: OffsetDateTime?, - val lastUpdateDate: OffsetDateTime?, - val userPreferences: UserPreferences?, - val subArrangements: List?, - val state: ProductState?, - val parentId: String?, - val financialInstitutionId: Long?, - val lastSyncDate: OffsetDateTime?, - val unMaskableAttributes: Set?, - val additions: Map?, - val displayName: String?, - val cardDetails: CardDetails?, - val interestDetails: InterestDetails?, - val reservedAmount: BigDecimal?, - val remainingPeriodicTransfers: BigDecimal?, - val nextClosingDate: LocalDate?, - val overdueSince: LocalDate?, - val externalAccountStatus: String?, -) : Parcelable { - - /** - * A builder for [DebitCard]. - */ - class Builder { - - /** - * See [DebitCard.debitCardsItems]. - */ - var debitCardsItems: Set? = null - - /** - * See [DebitCard.number]. - */ - var number: String? = null - - /** - * See [DebitCard.urgentTransferAllowed]. - */ - var urgentTransferAllowed: Boolean? = null - - /** - * See [DebitCard.cardNumber]. - */ - var cardNumber: BigDecimal? = null - - /** - * See [DebitCard.accountInterestRate]. - */ - var accountInterestRate: BigDecimal? = null - - /** - * See [DebitCard.accountHolderNames]. - */ - var accountHolderNames: String? = null - - /** - * See [DebitCard.startDate]. - */ - var startDate: OffsetDateTime? = null - - /** - * See [DebitCard.validThru]. - */ - var validThru: OffsetDateTime? = null - - /** - * See [DebitCard.id]. - */ - var id: String? = null - - /** - * See [DebitCard.name]. - */ - var name: String? = null - - /** - * See [DebitCard.externalTransferAllowed]. - */ - var externalTransferAllowed: Boolean? = null - - /** - * See [DebitCard.crossCurrencyAllowed]. - */ - var crossCurrencyAllowed: Boolean? = null - - /** - * See [DebitCard.productKindName]. - */ - var productKindName: String? = null - - /** - * See [DebitCard.productTypeName]. - */ - var productTypeName: String? = null - - /** - * See [DebitCard.bankAlias]. - */ - var bankAlias: String? = null - - /** - * See [DebitCard.sourceId]. - */ - var sourceId: String? = null - - /** - * See [DebitCard.accountOpeningDate]. - */ - var accountOpeningDate: OffsetDateTime? = null - - /** - * See [DebitCard.lastUpdateDate]. - */ - var lastUpdateDate: OffsetDateTime? = null - - /** - * See [DebitCard.userPreferences]. - */ - var userPreferences: UserPreferences? = null - - /** - * See [DebitCard.subArrangements]. - */ - var subArrangements: List? = null - - /** - * See [DebitCard.state]. - */ - var state: ProductState? = null - - /** - * See [DebitCard.parentId]. - */ - var parentId: String? = null - - /** - * See [DebitCard.financialInstitutionId]. - */ - var financialInstitutionId: Long? = null - - /** - * See [DebitCard.lastSyncDate]. - */ - var lastSyncDate: OffsetDateTime? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.debit_card.DebitCard.unMaskableAttributes]. - */ - var unMaskableAttributes: Set? = null - - /** - * See [DebitCard.additions]. - */ - var additions: Map? = null - - /** - * See [DebitCard.displayName]. - */ - var displayName: String? = null - - /** - * See [DebitCard.cardDetails]. - */ - var cardDetails: CardDetails? = null - - /** - * See [DebitCard.interestDetails]. - */ - var interestDetails: InterestDetails? = null - - /** - * See [DebitCard.reservedAmount]. - */ - var reservedAmount: BigDecimal? = null - - /** - * See [DebitCard.remainingPeriodicTransfers]. - */ - var remainingPeriodicTransfers: BigDecimal? = null - - /** - * See [DebitCard.nextClosingDate]. - */ - var nextClosingDate: LocalDate? = null - - /** - * See [DebitCard.overdueSince]. - */ - var overdueSince: LocalDate? = null - - /** - * See [DebitCard.externalAccountStatus]. - */ - var externalAccountStatus: String? = null - - /** - * See [DebitCard.debitCardsItems]. - */ - fun setDebitCardsItems(debitCardsItems: Set) = - apply { this.debitCardsItems = debitCardsItems } - - /** - * See [DebitCard.number]. - */ - fun setNumber(number: String?) = apply { this.number = number } - - /** - * See [DebitCard.urgentTransferAllowed]. - */ - fun setUrgentTransferAllowed(urgentTransferAllowed: Boolean?) = - apply { this.urgentTransferAllowed = urgentTransferAllowed } - - /** - * See [DebitCard.cardNumber]. - */ - fun setCardNumber(cardNumber: BigDecimal?) = apply { this.cardNumber = cardNumber } - - /** - * See [DebitCard.accountInterestRate]. - */ - fun setAccountInterestRate(accountInterestRate: BigDecimal?) = - apply { this.accountInterestRate = accountInterestRate } - - /** - * See [DebitCard.accountHolderNames]. - */ - fun setAccountHolderNames(accountHolderNames: String?) = - apply { this.accountHolderNames = accountHolderNames } - - /** - * See [DebitCard.startDate]. - */ - fun setStartDate(startDate: OffsetDateTime?) = apply { this.startDate = startDate } - - /** - * See [DebitCard.validThru]. - */ - fun setValidThru(validThru: OffsetDateTime?) = apply { this.validThru = validThru } - - /** - * See [DebitCard.id]. - */ - fun setId(id: String?) = apply { this.id = id } - - /** - * See [DebitCard.name]. - */ - fun setName(name: String?) = apply { this.name = name } - - /** - * See [DebitCard.externalTransferAllowed]. - */ - fun setExternalTransferAllowed(externalTransferAllowed: Boolean?) = - apply { this.externalTransferAllowed = externalTransferAllowed } - - /** - * See [DebitCard.crossCurrencyAllowed]. - */ - fun setCrossCurrencyAllowed(crossCurrencyAllowed: Boolean?) = - apply { this.crossCurrencyAllowed = crossCurrencyAllowed } - - /** - * See [DebitCard.productKindName]. - */ - fun setProductKindName(productKindName: String?) = apply { this.productKindName = productKindName } - - /** - * See [DebitCard.productTypeName]. - */ - fun setProductTypeName(productTypeName: String?) = apply { this.productTypeName = productTypeName } - - /** - * See [DebitCard.bankAlias]. - */ - fun setBankAlias(bankAlias: String?) = apply { this.bankAlias = bankAlias } - - /** - * See [DebitCard.sourceId]. - */ - fun setSourceId(sourceId: String?) = apply { this.sourceId = sourceId } - - /** - * See [DebitCard.accountOpeningDate]. - */ - fun setAccountOpeningDate(accountOpeningDate: OffsetDateTime?) = - apply { this.accountOpeningDate = accountOpeningDate } - - /** - * See [DebitCard.lastUpdateDate]. - */ - fun setLastUpdateDate(lastUpdateDate: OffsetDateTime?) = - apply { this.lastUpdateDate = lastUpdateDate } - - /** - * See [DebitCard.userPreferences]. - */ - fun setUserPreferences(userPreferences: UserPreferences?) = apply { this.userPreferences = userPreferences } - - /** - * See [DebitCard.subArrangements]. - */ - fun setSubArrangements(subArrangements: List?) = apply { - this.subArrangements = subArrangements - } - - /** - * See [DebitCard.state]. - */ - fun setState(state: ProductState?) = apply { this.state = state } - - /** - * See [DebitCard.parentId]. - */ - fun setParentId(parentId: String?) = apply { this.parentId = parentId } - - /** - * See [DebitCard.financialInstitutionId]. - */ - fun setFinancialInstitutionId(financialInstitutionId: Long?) = - apply { this.financialInstitutionId = financialInstitutionId } - - /** - * See [DebitCard.lastSyncDate]. - */ - fun setLastSyncDate(lastSyncDate: OffsetDateTime?) = apply { this.lastSyncDate = lastSyncDate } - - /** - * See [DebitCard.unMaskableAttributes]. - */ - fun setUnMaskableAttributes(unMaskableAttributes: Set?) = - apply { this.unMaskableAttributes = unMaskableAttributes } - - /** - * See [DebitCard.additions]. - */ - fun setAdditions(additions: Map?) = - apply { this.additions = additions } - - /** - * See [DebitCard.displayName]. - */ - fun setDisplayName(displayName: String?) = - apply { this.displayName = displayName } - - /** - * See [DebitCard.cardDetails]. - */ - fun setCardDetails(cardDetails: CardDetails?) = - apply { this.cardDetails = cardDetails } - - /** - * See [DebitCard.reservedAmount]. - */ - fun setReservedAmount(reservedAmount: BigDecimal?) = - apply { this.reservedAmount = reservedAmount } - - /** - * See [DebitCard.remainingPeriodicTransfers]. - */ - fun setRemainingPeriodicTransfers(remainingPeriodicTransfers: BigDecimal?) = - apply { this.remainingPeriodicTransfers = remainingPeriodicTransfers } - - /** - * See [DebitCard.nextClosingDate]. - */ - fun setNextClosingDate(nextClosingDate: LocalDate?) = - apply { this.nextClosingDate = nextClosingDate } - - /** - * See [DebitCard.overdueSince]. - */ - fun setOverdueSince(overdueSince: LocalDate?) = - apply { this.overdueSince = overdueSince } - - /** - * See [DebitCard.externalAccountStatus]. - */ - fun setExternalAccountStatus(externalAccountStatus: String?) = - apply { this.externalAccountStatus = externalAccountStatus } - - /** - * See [DebitCard.interestDetails]. - */ - fun setInterestDetails(interestDetails: InterestDetails?) = - apply { this.interestDetails = interestDetails } - - /** - * Builds an instance of [DebitCard]. - */ - fun build() = DebitCard( - debitCardsItems = debitCardsItems ?: setOf(), - number = number, - urgentTransferAllowed = urgentTransferAllowed, - cardNumber = cardNumber, - accountInterestRate = accountInterestRate, - accountHolderNames = accountHolderNames, - startDate = startDate, - validThru = validThru, - id = id, - name = name, - externalTransferAllowed = externalTransferAllowed, - crossCurrencyAllowed = crossCurrencyAllowed, - productKindName = productKindName, - productTypeName = productTypeName, - bankAlias = bankAlias, - sourceId = sourceId, - accountOpeningDate = accountOpeningDate, - lastUpdateDate = lastUpdateDate, - userPreferences = userPreferences, - subArrangements = subArrangements, - state = state, - parentId = parentId, - financialInstitutionId = financialInstitutionId, - lastSyncDate = lastSyncDate, - unMaskableAttributes = unMaskableAttributes, - additions = additions, - displayName = displayName, - cardDetails = cardDetails, - interestDetails = interestDetails, - reservedAmount = reservedAmount, - remainingPeriodicTransfers = remainingPeriodicTransfers, - nextClosingDate = nextClosingDate, - overdueSince = overdueSince, - externalAccountStatus = externalAccountStatus, - ) - } -} - -/** - * Builds an instance of [DebitCard] with the [initializer] parameters. - */ -@Suppress("FunctionName") // DSL initializer -fun DebitCard(initializer: DebitCard.Builder.() -> Unit): DebitCard { - return DebitCard.Builder().apply(initializer).build() -} diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/debit_card/DebitCards.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/debit_card/DebitCards.kt deleted file mode 100644 index d6fee997..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/debit_card/DebitCards.kt +++ /dev/null @@ -1,111 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.debit_card - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.common.AggregatedBalance -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param products The list of debit cards. - * @param name The label/name of the debit card. - * @param displayName The label/name of the debit card used to display on the screen. - * @param aggregatedBalance The aggregated balance of this group of products. - * @param additions Extra parameters - */ -@Poko -@Parcelize -class DebitCards private constructor( - val products: List, - val name: String?, - val displayName: String?, - val aggregatedBalance: AggregatedBalance?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [DebitCards.products] - */ - var products: List? = null - - /** - * See [DebitCards.name] - */ - var name: String? = null - - /** - * See [DebitCards.displayName] - */ - var displayName: String? = null - - /** - * See [DebitCards.aggregatedBalance] - */ - var aggregatedBalance: AggregatedBalance? = null - - /** - * See [DebitCards.additions] - */ - var additions: Map? = null - - /** - * See [DebitCards.products] - */ - fun setProducts(products: List) = apply { - this.products = products - } - - /** - * See [DebitCards.name] - */ - fun setName(name: String?) = apply { - this.name = name - } - - /** - * See [DebitCards.displayName] - */ - fun setDisplayName(displayName: String?) = apply { - this.displayName = displayName - } - - /** - * See [DebitCards.aggregatedBalance] - */ - fun setAggregatedBalance(aggregatedBalance: AggregatedBalance?) = apply { - this.aggregatedBalance = aggregatedBalance - } - - /** - * See [DebitCards.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Builds an instance of [DebitCards] - */ - fun build() = DebitCards( - requireNotNull(products), - name, - displayName, - aggregatedBalance, - additions - ) - } -} - -/** - * DSL to create [DebitCards] - */ -fun DebitCards(block: DebitCards.Builder.() -> Unit) = DebitCards.Builder().apply(block).build() - -internal fun DebitCards?.allProducts(): List = this?.products ?: emptyList() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/investment_accounts/InvestmentAccount.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/investment_accounts/InvestmentAccount.kt deleted file mode 100644 index b47eecfc..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/investment_accounts/InvestmentAccount.kt +++ /dev/null @@ -1,545 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.investment_accounts - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import com.backbase.accounts_journey.domain.model.common.BaseProduct -import com.backbase.accounts_journey.domain.model.common.CardDetails -import com.backbase.accounts_journey.domain.model.common.InterestDetails -import com.backbase.accounts_journey.domain.model.common.ProductState -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal -import java.time.LocalDate -import java.time.OffsetDateTime - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param currentInvestmentValue - * @param currency - * @param urgentTransferAllowed Defines if urgent transfer is allowed. - * @param productNumber The number identifying the contract. - * @param IBAN The International Bank Account Number. If specified, it must be a valid IBAN, otherwise an invalid value error could be raised. - * @param BBAN Specifying the BBAN of the account - BBAN is short for Basic Bank Account Number. It represents a country-specific bank account number. - * @param id Reference to the product of which the arrangement is an instantiation. - * @param name - * @param externalTransferAllowed Defines if transfer to another party is allowed. - * @param crossCurrencyAllowed Defines if cross currency transfer is allowed - * @param productKindName The label/name that is used for the respective product kind - * @param productTypeName The label/name that is used to label a specific product type - * @param bankAlias The name that can be assigned by the bank to label the arrangement. - * @param sourceId Indicate if the account is regular or external - * @param accountOpeningDate The date of activation of the account in the bank's system. Defaults to null - * @param lastUpdateDate Last date of parameter update for the arrangement. - * @param userPreferences The preferences configured by the user. - * @param state - * @param parentId Reference to the parent of the arrangement. - * @param financialInstitutionId Financial institution ID - * @param lastSyncDate Last synchronization datetime - * @param subArrangements A list of arrangements whose parent is this product. - * @param unMaskableAttributes An optional list of the maskable attributes that can be unmasked. - * @param additions Extra parameters - * @param displayName name of the particular product - * @param cardDetails - * @param interestDetails - * @param reservedAmount The reservation of a portion of a credit or debit balance for the cost of services not yet rendered. - * @param remainingPeriodicTransfers The limitation in periodic saving transfers or withdrawals. In the case of the US, Regulation D enables for a maximum of 6 monthly savings transfers or withdrawals. - * @param nextClosingDate The last day of the forthcoming billing cycle. - * @param overdueSince The date in which the arrangement has been overdue since. - * @param externalAccountStatus Synchronization statuses an account can have on the provider side after it has been aggregated. - * @param accruedInterest The interest that is earned (credit interest) or due (debit interest) but not settled yet. Defaults to null - * @param creditLimitExpiryDate The date after which overdraft will no longer be available to the account (renewed automatically or cancelled). - * @param valueDateBalance The balance of the account on a specific date that needs to be used for the calculation of interest. NB! If no date is specified (like for the book date balance) the current date can be assumed. - * @param accountHolderNames Party(s) with a relationship to the account. - */ -@Suppress("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class InvestmentAccount internal constructor( - val currentInvestmentValue: String?, - val currency: String?, - val urgentTransferAllowed: Boolean?, - val productNumber: String?, - @SuppressWarnings("ConstructorParameterNaming") val IBAN: String?, - @SuppressWarnings("ConstructorParameterNaming") val BBAN: String?, - val unMaskableAttributes: Set?, - val id: String?, - val name: String?, - val displayName: String?, - val externalTransferAllowed: Boolean?, - val crossCurrencyAllowed: Boolean?, - val productKindName: String?, - val productTypeName: String?, - val bankAlias: String?, - val sourceId: String?, - val accountOpeningDate: OffsetDateTime?, - val lastUpdateDate: OffsetDateTime?, - val userPreferences: UserPreferences?, - val state: ProductState?, - val parentId: String?, - val subArrangements: List?, - val financialInstitutionId: Long?, - val lastSyncDate: OffsetDateTime?, - val cardDetails: CardDetails?, - val interestDetails: InterestDetails?, - val reservedAmount: BigDecimal?, - val remainingPeriodicTransfers: BigDecimal?, - val nextClosingDate: LocalDate?, - val overdueSince: LocalDate?, - val externalAccountStatus: String?, - val additions: Map?, - val accruedInterest: BigDecimal?, - val creditLimitExpiryDate: OffsetDateTime?, - val valueDateBalance: BigDecimal?, - val accountHolderNames: String?, -) : Parcelable { - - /** - * A builder for [InvestmentAccount]. - */ - class Builder { - - /** - * See [InvestmentAccount.currentInvestmentValue]. - */ - var currentInvestmentValue: String? = null - - /** - * See [InvestmentAccount.currency]. - */ - var currency: String? = null - - /** - * See [InvestmentAccount.urgentTransferAllowed]. - */ - var urgentTransferAllowed: Boolean? = null - - /** - * See [InvestmentAccount.productNumber]. - */ - var productNumber: String? = null - - /** - * See [InvestmentAccount.IBAN]. - */ - @SuppressWarnings("VariableNaming") - var IBAN: String? = null - - /** - * See [InvestmentAccount.BBAN]. - */ - @SuppressWarnings("VariableNaming") - var BBAN: String? = null - - /** - * See [InvestmentAccount.id]. - */ - var id: String? = null - - /** - * See [InvestmentAccount.name]. - */ - var name: String? = null - - /** - * See [InvestmentAccount.externalTransferAllowed]. - */ - var externalTransferAllowed: Boolean? = null - - /** - * See [InvestmentAccount.crossCurrencyAllowed]. - */ - var crossCurrencyAllowed: Boolean? = null - - /** - * See [InvestmentAccount.productKindName]. - */ - var productKindName: String? = null - - /** - * See [InvestmentAccount.productTypeName]. - */ - var productTypeName: String? = null - - /** - * See [InvestmentAccount.bankAlias]. - */ - var bankAlias: String? = null - - /** - * See [InvestmentAccount.sourceId]. - */ - var sourceId: String? = null - - /** - * See [InvestmentAccount.accountOpeningDate]. - */ - var accountOpeningDate: OffsetDateTime? = null - - /** - * See [InvestmentAccount.lastUpdateDate]. - */ - var lastUpdateDate: OffsetDateTime? = null - - /** - * See [InvestmentAccount.userPreferences]. - */ - var userPreferences: UserPreferences? = null - - /** - * See [InvestmentAccount.state]. - */ - var state: ProductState? = null - - /** - * See [InvestmentAccount.parentId]. - */ - var parentId: String? = null - - /** - * See [InvestmentAccount.financialInstitutionId]. - */ - var financialInstitutionId: Long? = null - - /** - * See [InvestmentAccount.lastSyncDate]. - */ - var lastSyncDate: OffsetDateTime? = null - - /** - * See [InvestmentAccount.subArrangements]. - */ - var subArrangements: List? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.investment_accounts.InvestmentAccount.unMaskableAttributes]. - */ - var unMaskableAttributes: Set? = null - - /** - * See [InvestmentAccount.additions]. - */ - var additions: Map? = null - - /** - * See [InvestmentAccount.displayName]. - */ - var displayName: String? = null - - /** - * See [InvestmentAccount.cardDetails]. - */ - var cardDetails: CardDetails? = null - - /** - * See [InvestmentAccount.interestDetails]. - */ - var interestDetails: InterestDetails? = null - - /** - * See [InvestmentAccount.reservedAmount]. - */ - var reservedAmount: BigDecimal? = null - - /** - * See [InvestmentAccount.remainingPeriodicTransfers]. - */ - var remainingPeriodicTransfers: BigDecimal? = null - - /** - * See [InvestmentAccount.nextClosingDate]. - */ - var nextClosingDate: LocalDate? = null - - /** - * See [InvestmentAccount.overdueSince]. - */ - var overdueSince: LocalDate? = null - - /** - * See [InvestmentAccount.externalAccountStatus]. - */ - var externalAccountStatus: String? = null - - /** - * See [InvestmentAccount.accruedInterest]. - */ - var accruedInterest: BigDecimal? = null - - /** - * See [InvestmentAccount.creditLimitExpiryDate]. - */ - var creditLimitExpiryDate: OffsetDateTime? = null - - /** - * See [InvestmentAccount.valueDateBalance]. - */ - var valueDateBalance: BigDecimal? = null - - /** - * See [InvestmentAccount.accountHolderNames]. - */ - var accountHolderNames: String? = null - - /** - * See [InvestmentAccount.currentInvestmentValue]. - */ - fun setCurrentInvestmentValue(currentInvestmentValue: String?) = - apply { this.currentInvestmentValue = currentInvestmentValue } - - /** - * See [InvestmentAccount.currency]. - */ - fun setCurrency(currency: String?) = apply { this.currency = currency } - - /** - * See [InvestmentAccount.urgentTransferAllowed]. - */ - fun setUrgentTransferAllowed(urgentTransferAllowed: Boolean?) = - apply { this.urgentTransferAllowed = urgentTransferAllowed } - - /** - * See [InvestmentAccount.productNumber]. - */ - fun setProductNumber(productNumber: String?) = apply { this.productNumber = productNumber } - - /** - * See [InvestmentAccount.IBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setIBAN(IBAN: String?) = apply { this.IBAN = IBAN } - - /** - * See [InvestmentAccount.BBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setBBAN(BBAN: String?) = apply { this.BBAN = BBAN } - - /** - * See [InvestmentAccount.id]. - */ - fun setId(id: String?) = apply { this.id = id } - - /** - * See [InvestmentAccount.name]. - */ - fun setName(name: String?) = apply { this.name = name } - - /** - * See [InvestmentAccount.externalTransferAllowed]. - */ - fun setExternalTransferAllowed(externalTransferAllowed: Boolean?) = - apply { this.externalTransferAllowed = externalTransferAllowed } - - /** - * See [InvestmentAccount.crossCurrencyAllowed]. - */ - fun setCrossCurrencyAllowed(crossCurrencyAllowed: Boolean?) = - apply { this.crossCurrencyAllowed = crossCurrencyAllowed } - - /** - * See [InvestmentAccount.productKindName]. - */ - fun setProductKindName(productKindName: String?) = apply { this.productKindName = productKindName } - - /** - * See [InvestmentAccount.productTypeName]. - */ - fun setProductTypeName(productTypeName: String?) = apply { this.productTypeName = productTypeName } - - /** - * See [InvestmentAccount.bankAlias]. - */ - fun setBankAlias(bankAlias: String?) = apply { this.bankAlias = bankAlias } - - /** - * See [InvestmentAccount.sourceId]. - */ - fun setSourceId(sourceId: String?) = apply { this.sourceId = sourceId } - - /** - * See [InvestmentAccount.accountOpeningDate]. - */ - fun setAccountOpeningDate(accountOpeningDate: OffsetDateTime?) = - apply { this.accountOpeningDate = accountOpeningDate } - - /** - * See [InvestmentAccount.lastUpdateDate]. - */ - fun setLastUpdateDate(lastUpdateDate: OffsetDateTime?) = - apply { this.lastUpdateDate = lastUpdateDate } - - /** - * See [InvestmentAccount.userPreferences]. - */ - fun setUserPreferences(userPreferences: UserPreferences?) = apply { this.userPreferences = userPreferences } - - /** - * See [InvestmentAccount.state]. - */ - fun setState(state: ProductState?) = apply { this.state = state } - - /** - * See [InvestmentAccount.parentId]. - */ - fun setParentId(parentId: String?) = apply { this.parentId = parentId } - - /** - * See [InvestmentAccount.financialInstitutionId]. - */ - fun setFinancialInstitutionId(financialInstitutionId: Long?) = - apply { this.financialInstitutionId = financialInstitutionId } - - /** - * See [InvestmentAccount.lastSyncDate]. - */ - fun setLastSyncDate(lastSyncDate: OffsetDateTime?) = apply { this.lastSyncDate = lastSyncDate } - - /** - * See [InvestmentAccount.subArrangements]. - */ - fun setSubArrangements(subArrangements: List?) = apply { - this.subArrangements = subArrangements - } - - /** - * See [InvestmentAccount.unMaskableAttributes]. - */ - fun setUnMaskableAttributes(unMaskableAttributes: Set?) = apply { - this.unMaskableAttributes = unMaskableAttributes - } - - /** - * See [InvestmentAccount.additions]. - */ - fun setAdditions(additions: Map?) = - apply { this.additions = additions } - - /** - * See [InvestmentAccount.displayName]. - */ - fun setDisplayName(displayName: String?) = - apply { this.displayName = displayName } - - /** - * See [InvestmentAccount.cardDetails]. - */ - fun setCardDetails(cardDetails: CardDetails?) = - apply { this.cardDetails = cardDetails } - - /** - * See [InvestmentAccount.reservedAmount]. - */ - fun setReservedAmount(reservedAmount: BigDecimal?) = - apply { this.reservedAmount = reservedAmount } - - /** - * See [InvestmentAccount.remainingPeriodicTransfers]. - */ - fun setRemainingPeriodicTransfers(remainingPeriodicTransfers: BigDecimal?) = - apply { this.remainingPeriodicTransfers = remainingPeriodicTransfers } - - /** - * See [InvestmentAccount.nextClosingDate]. - */ - fun setNextClosingDate(nextClosingDate: LocalDate?) = - apply { this.nextClosingDate = nextClosingDate } - - /** - * See [InvestmentAccount.overdueSince]. - */ - fun setOverdueSince(overdueSince: LocalDate?) = - apply { this.overdueSince = overdueSince } - - /** - * See [InvestmentAccount.externalAccountStatus]. - */ - fun setExternalAccountStatus(externalAccountStatus: String?) = - apply { this.externalAccountStatus = externalAccountStatus } - - /** - * See [InvestmentAccount.interestDetails]. - */ - fun setInterestDetails(interestDetails: InterestDetails?) = - apply { this.interestDetails = interestDetails } - - /** - * See [InvestmentAccount.accruedInterest]. - */ - fun setAccruedInterest(accruedInterest: BigDecimal?) = apply { - this.accruedInterest = accruedInterest - } - - /** - * See [InvestmentAccount.creditLimitExpiryDate]. - */ - fun setCreditLimitExpiryDate(creditLimitExpiryDate: OffsetDateTime?) = apply { - this.creditLimitExpiryDate = creditLimitExpiryDate - } - - /** - * See [InvestmentAccount.valueDateBalance]. - */ - fun setValueDateBalance(valueDateBalance: BigDecimal?) = apply { - this.valueDateBalance = valueDateBalance - } - - /** - * See [InvestmentAccount.accountHolderNames]. - */ - fun setAccountHolderNames(accountHolderNames: String?) = apply { - this.accountHolderNames = accountHolderNames - } - - /** - * Builds an instance of [InvestmentAccount]. - */ - fun build() = InvestmentAccount( - currentInvestmentValue = currentInvestmentValue, - currency = currency, - urgentTransferAllowed = urgentTransferAllowed, - productNumber = productNumber, - IBAN = IBAN, - BBAN = BBAN, - id = id, - name = name, - externalTransferAllowed = externalTransferAllowed, - crossCurrencyAllowed = crossCurrencyAllowed, - productKindName = productKindName, - productTypeName = productTypeName, - bankAlias = bankAlias, - sourceId = sourceId, - accountOpeningDate = accountOpeningDate, - lastUpdateDate = lastUpdateDate, - userPreferences = userPreferences, - state = state, - parentId = parentId, - financialInstitutionId = financialInstitutionId, - lastSyncDate = lastSyncDate, - subArrangements = subArrangements, - unMaskableAttributes = unMaskableAttributes, - additions = additions, - displayName = displayName, - cardDetails = cardDetails, - interestDetails = interestDetails, - reservedAmount = reservedAmount, - remainingPeriodicTransfers = remainingPeriodicTransfers, - nextClosingDate = nextClosingDate, - overdueSince = overdueSince, - externalAccountStatus = externalAccountStatus, - accruedInterest = accruedInterest, - creditLimitExpiryDate = creditLimitExpiryDate, - valueDateBalance = valueDateBalance, - accountHolderNames = accountHolderNames, - ) - } -} - -/** - * Builds an instance of [InvestmentAccount] with the [initializer] parameters. - */ -@Suppress("FunctionName") // DSL initializer -fun InvestmentAccount(initializer: InvestmentAccount.Builder.() -> Unit): InvestmentAccount { - return InvestmentAccount.Builder().apply(initializer).build() -} diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/investment_accounts/InvestmentAccounts.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/investment_accounts/InvestmentAccounts.kt deleted file mode 100644 index bb7ca93c..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/investment_accounts/InvestmentAccounts.kt +++ /dev/null @@ -1,96 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.investment_accounts - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.common.AggregatedBalance -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param products The list of investments. - * @param name The label/name of an investment account. - * @param aggregatedBalance The aggregated balance of this group of products. - * @param additions Extra parameters - */ -@Poko -@Parcelize -class InvestmentAccounts private constructor( - val products: List, - val name: String?, - val aggregatedBalance: AggregatedBalance?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [InvestmentAccounts.products] - */ - var products: List? = null - - /** - * See [InvestmentAccounts.name] - */ - var name: String? = null - - /** - * See [InvestmentAccounts.aggregatedBalance] - */ - var aggregatedBalance: AggregatedBalance? = null - - /** - * See [InvestmentAccounts.additions] - */ - var additions: Map? = null - - /** - * See [InvestmentAccounts.products] - */ - fun setProducts(products: List) = apply { - this.products = products - } - - /** - * See [InvestmentAccounts.name] - */ - fun setName(name: String?) = apply { - this.name = name - } - - /** - * See [InvestmentAccounts.aggregatedBalance] - */ - fun setAggregatedBalance(aggregatedBalance: AggregatedBalance?) = apply { - this.aggregatedBalance = aggregatedBalance - } - - /** - * See [InvestmentAccounts.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Builds an instance of [InvestmentAccounts] - */ - fun build() = InvestmentAccounts( - requireNotNull(products), - name, - aggregatedBalance, - additions - ) - } -} - -/** - * DSL to create [InvestmentAccounts] - */ -fun InvestmentAccounts(block: InvestmentAccounts.Builder.() -> Unit) = InvestmentAccounts.Builder().apply(block).build() - -internal fun InvestmentAccounts?.allProducts(): List = this?.products ?: emptyList() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/loan/Loan.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/loan/Loan.kt deleted file mode 100644 index 93db5b6e..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/loan/Loan.kt +++ /dev/null @@ -1,757 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.loan - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import com.backbase.accounts_journey.domain.model.common.BaseProduct -import com.backbase.accounts_journey.domain.model.common.CardDetails -import com.backbase.accounts_journey.domain.model.common.InterestDetails -import com.backbase.accounts_journey.domain.model.common.ProductState -import com.backbase.accounts_journey.domain.model.common.TimeUnit -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal -import java.time.LocalDate -import java.time.OffsetDateTime - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param bookedBalance - * @param principalAmount - * @param currency - * @param urgentTransferAllowed Defines if urgent transfer is allowed. - * @param productNumber The number identifying the contract. - * @param accountInterestRate The annualized cost of credit or debt-capital computed as the percentage ratio of interest to the principal. - * @param termUnit - * @param termNumber The number of times interest rate is paid on the settlement account. - * @param outstandingPrincipalAmount This IS the value date balance of the arrangement. - * @param monthlyInstalmentAmount A fixed payment amount paid by a borrower to the bank at a specified date each calendar month. - * @param amountInArrear The part of a debt that is overdue after missing one or more required payments. The amount of the arrears is the amount accrued from the date on which the first missed payment was due. - * @param interestSettlementAccount Account that provides quick access to accumulated cash to facilitate daily settlements with other businesses. - * @param accruedInterest - * @param accountHolderNames Party(s) with a relationship to the account. - * @param maturityDate End term of a holding period. - * @param valueDateBalance The balance of the account on a specific date that needs to be used for the calculation of interest. NB! If no date is specified (like for the book date balance) the current date can be assumed. - * @param creditAccount Indicator whether or not the arrangement can be used in payment orders as credit account. - * @param debitAccount Indicator whether or not the arrangement can be used in payment orders as debit account. - * @param IBAN The International Bank Account Number. If specified, it must be a valid IBAN, otherwise an invalid value error could be raised. - * @param BBAN Specifying the BBAN of the account - BBAN is short for Basic Bank Account Number. It represents a country-specific bank account number. - * @param unMaskableAttributes An optional list of the maskable attributes that can be unmasked. - * @param id Reference to the product of which the arrangement is an instantiation. - * @param name - * @param externalTransferAllowed Defines if transfer to another party is allowed. - * @param crossCurrencyAllowed Defines if cross currency transfer is allowed - * @param productKindName The label/name that is used for the respective product kind - * @param productTypeName The label/name that is used to label a specific product type - * @param bankAlias The name that can be assigned by the bank to label the arrangement. - * @param sourceId Indicate if the account is regular or external - * @param accountOpeningDate - * @param lastUpdateDate Last date of parameter update for the arrangement. - * @param userPreferences The preferences configured by the user. - * @param state - * @param parentId Reference to the parent of the arrangement. - * @param financialInstitutionId Financial institution ID - * @param subArrangements A list of arrangements whose parent is this product. - * @param lastSyncDate Last synchronization datetime - * @param additions Extra parameters - * @param displayName name of the particular product - * @param cardDetails - * @param interestDetails - * @param reservedAmount The reservation of a portion of a credit or debit balance for the cost of services not yet rendered. - * @param remainingPeriodicTransfers The limitation in periodic saving transfers or withdrawals. In the case of the US, Regulation D enables for a maximum of 6 monthly savings transfers or withdrawals. - * @param nextClosingDate The last day of the forthcoming billing cycle. - * @param overdueSince The date in which the arrangement has been overdue since. - * @param externalAccountStatus Synchronization statuses an account can have on the provider side after it has been aggregated. - * @param bankBranchCode (This is to accomodate additional country specific fields like Sort Code in UK) - * @param bankBranchCode2 (This is to accomodate additional country specific fields fedwire Routing Nmber) - * @param availableBalance - * @param creditLimit - * @param minimumPayment The minimum payment set a percentage of balance, or a fixed cash amount. - * @param minimumPaymentDueDate Minimum Payment Due Date shown on your monthly statement to remain in good standing. - */ -@Suppress("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class Loan internal constructor( - val bookedBalance: String?, - val principalAmount: BigDecimal?, - val currency: String?, - val urgentTransferAllowed: Boolean?, - val productNumber: String?, - val accountInterestRate: BigDecimal?, - val termUnit: TimeUnit?, - val termNumber: BigDecimal?, - val outstandingPrincipalAmount: BigDecimal?, - val monthlyInstalmentAmount: BigDecimal?, - val amountInArrear: BigDecimal?, - val interestSettlementAccount: String?, - val accruedInterest: BigDecimal?, - val accountHolderNames: String?, - val maturityDate: OffsetDateTime?, - val valueDateBalance: BigDecimal?, - val creditAccount: Boolean?, - val debitAccount: Boolean?, - @SuppressWarnings("ConstructorParameterNaming") val IBAN: String?, - @SuppressWarnings("ConstructorParameterNaming") val BBAN: String?, - val unMaskableAttributes: Set?, - val id: String?, - val name: String?, - val externalTransferAllowed: Boolean?, - val crossCurrencyAllowed: Boolean?, - val productKindName: String?, - val productTypeName: String?, - val bankAlias: String?, - val sourceId: String?, - val accountOpeningDate: OffsetDateTime?, - val lastUpdateDate: OffsetDateTime?, - val userPreferences: UserPreferences?, - val state: ProductState?, - val parentId: String?, - val financialInstitutionId: Long?, - val subArrangements: List?, - val lastSyncDate: OffsetDateTime?, - val additions: Map?, - val displayName: String?, - val cardDetails: CardDetails?, - val interestDetails: InterestDetails?, - val reservedAmount: BigDecimal?, - val remainingPeriodicTransfers: BigDecimal?, - val nextClosingDate: LocalDate?, - val overdueSince: LocalDate?, - val externalAccountStatus: String?, - val bankBranchCode: String?, - val bankBranchCode2: String?, - val availableBalance: String?, - val creditLimit: String?, - val minimumPayment: BigDecimal?, - val minimumPaymentDueDate: OffsetDateTime?, -) : Parcelable { - - /** - * A builder for [Loan]. - */ - class Builder { - - /** - * See [Loan.bookedBalance]. - */ - var bookedBalance: String? = null - - /** - * See [Loan.principalAmount]. - */ - var principalAmount: BigDecimal? = null - - /** - * See [Loan.currency]. - */ - var currency: String? = null - - /** - * See [Loan.urgentTransferAllowed]. - */ - var urgentTransferAllowed: Boolean? = null - - /** - * See [Loan.productNumber]. - */ - var productNumber: String? = null - - /** - * See [Loan.accountInterestRate]. - */ - var accountInterestRate: BigDecimal? = null - - /** - * See [Loan.termUnit]. - */ - var termUnit: TimeUnit? = null - - /** - * See [Loan.termNumber]. - */ - var termNumber: BigDecimal? = null - - /** - * See [Loan.outstandingPrincipalAmount]. - */ - var outstandingPrincipalAmount: BigDecimal? = null - - /** - * See [Loan.monthlyInstalmentAmount]. - */ - var monthlyInstalmentAmount: BigDecimal? = null - - /** - * See [Loan.amountInArrear]. - */ - var amountInArrear: BigDecimal? = null - - /** - * See [Loan.interestSettlementAccount]. - */ - var interestSettlementAccount: String? = null - - /** - * See [Loan.accruedInterest]. - */ - var accruedInterest: BigDecimal? = null - - /** - * See [Loan.accountHolderNames]. - */ - var accountHolderNames: String? = null - - /** - * See [Loan.maturityDate]. - */ - var maturityDate: OffsetDateTime? = null - - /** - * See [Loan.valueDateBalance]. - */ - var valueDateBalance: BigDecimal? = null - - /** - * See [Loan.creditAccount]. - */ - var creditAccount: Boolean? = null - - /** - * See [Loan.debitAccount]. - */ - var debitAccount: Boolean? = null - - /** - * See [Loan.IBAN]. - */ - @SuppressWarnings("VariableNaming") - var IBAN: String? = null - - /** - * See [Loan.BBAN]. - */ - @SuppressWarnings("VariableNaming") - var BBAN: String? = null - - /** - * See [Loan.unMaskableAttributes]. - */ - var unMaskableAttributes: Set? = null - - /** - * See [Loan.id]. - */ - var id: String? = null - - /** - * See [Loan.name]. - */ - var name: String? = null - - /** - * See [Loan.externalTransferAllowed]. - */ - var externalTransferAllowed: Boolean? = null - - /** - * See [Loan.crossCurrencyAllowed]. - */ - var crossCurrencyAllowed: Boolean? = null - - /** - * See [Loan.productKindName]. - */ - var productKindName: String? = null - - /** - * See [Loan.productTypeName]. - */ - var productTypeName: String? = null - - /** - * See [Loan.bankAlias]. - */ - var bankAlias: String? = null - - /** - * See [Loan.sourceId]. - */ - var sourceId: String? = null - - /** - * See [Loan.accountOpeningDate]. - */ - var accountOpeningDate: OffsetDateTime? = null - - /** - * See [Loan.lastUpdateDate]. - */ - var lastUpdateDate: OffsetDateTime? = null - - /** - * See [Loan.userPreferences]. - */ - var userPreferences: UserPreferences? = null - - /** - * See [Loan.state]. - */ - var state: ProductState? = null - - /** - * See [Loan.parentId]. - */ - var parentId: String? = null - - /** - * See [Loan.financialInstitutionId]. - */ - var financialInstitutionId: Long? = null - - /** - * See [Loan.subArrangements]. - */ - var subArrangements: List? = null - - /** - * See [Loan.lastSyncDate]. - */ - var lastSyncDate: OffsetDateTime? = null - - /** - * See [Loan.additions]. - */ - var additions: Map? = null - - /** - * See [Loan.displayName]. - */ - var displayName: String? = null - - /** - * See [Loan.cardDetails]. - */ - var cardDetails: CardDetails? = null - - /** - * See [Loan.interestDetails]. - */ - var interestDetails: InterestDetails? = null - - /** - * See [Loan.reservedAmount]. - */ - var reservedAmount: BigDecimal? = null - - /** - * See [Loan.remainingPeriodicTransfers]. - */ - var remainingPeriodicTransfers: BigDecimal? = null - - /** - * See [Loan.nextClosingDate]. - */ - var nextClosingDate: LocalDate? = null - - /** - * See [Loan.overdueSince]. - */ - var overdueSince: LocalDate? = null - - /** - * See [Loan.externalAccountStatus]. - */ - var externalAccountStatus: String? = null - - /** - * See [Loan.bankBranchCode]. - */ - var bankBranchCode: String? = null - - /** - * See [Loan.bankBranchCode2]. - */ - var bankBranchCode2: String? = null - - /** - * See [Loan.availableBalance]. - */ - var availableBalance: String? = null - - /** - * See [Loan.creditLimit]. - */ - var creditLimit: String? = null - - /** - * See [Loan.minimumPayment]. - */ - var minimumPayment: BigDecimal? = null - - /** - * See [Loan.minimumPaymentDueDate]. - */ - var minimumPaymentDueDate: OffsetDateTime? = null - - /** - * See [Loan.bookedBalance]. - */ - fun setBookedBalance(bookedBalance: String?) = apply { this.bookedBalance = bookedBalance } - - /** - * See [Loan.principalAmount]. - */ - fun setPrincipalAmount(principalAmount: BigDecimal?) = - apply { this.principalAmount = principalAmount } - - /** - * See [Loan.currency]. - */ - fun setCurrency(currency: String?) = apply { this.currency = currency } - - /** - * See [Loan.urgentTransferAllowed]. - */ - fun setUrgentTransferAllowed(urgentTransferAllowed: Boolean?) = - apply { this.urgentTransferAllowed = urgentTransferAllowed } - - /** - * See [Loan.productNumber]. - */ - fun setProductNumber(productNumber: String?) = apply { this.productNumber = productNumber } - - /** - * See [Loan.accountInterestRate]. - */ - fun setAccountInterestRate(accountInterestRate: BigDecimal?) = - apply { this.accountInterestRate = accountInterestRate } - - /** - * See [Loan.termUnit]. - */ - fun setTermUnit(termUnit: TimeUnit?) = apply { this.termUnit = termUnit } - - /** - * See [Loan.termNumber]. - */ - fun setTermNumber(termNumber: BigDecimal?) = apply { this.termNumber = termNumber } - - /** - * See [Loan.outstandingPrincipalAmount]. - */ - fun setOutstandingPrincipalAmount(outstandingPrincipalAmount: BigDecimal?) = - apply { this.outstandingPrincipalAmount = outstandingPrincipalAmount } - - /** - * See [Loan.monthlyInstalmentAmount]. - */ - fun setMonthlyInstalmentAmount(monthlyInstalmentAmount: BigDecimal?) = - apply { this.monthlyInstalmentAmount = monthlyInstalmentAmount } - - /** - * See [Loan.amountInArrear]. - */ - fun setAmountInArrear(amountInArrear: BigDecimal?) = apply { this.amountInArrear = amountInArrear } - - /** - * See [Loan.interestSettlementAccount]. - */ - fun setInterestSettlementAccount(interestSettlementAccount: String?) = - apply { this.interestSettlementAccount = interestSettlementAccount } - - /** - * See [Loan.accruedInterest]. - */ - fun setAccruedInterest(accruedInterest: BigDecimal?) = - apply { this.accruedInterest = accruedInterest } - - /** - * See [Loan.accountHolderNames]. - */ - fun setAccountHolderNames(accountHolderNames: String?) = - apply { this.accountHolderNames = accountHolderNames } - - /** - * See [Loan.maturityDate]. - */ - fun setMaturityDate(maturityDate: OffsetDateTime?) = apply { this.maturityDate = maturityDate } - - /** - * See [Loan.valueDateBalance]. - */ - fun setValueDateBalance(valueDateBalance: BigDecimal?) = - apply { this.valueDateBalance = valueDateBalance } - - /** - * See [Loan.creditAccount]. - */ - fun setCreditAccount(creditAccount: Boolean?) = apply { this.creditAccount = creditAccount } - - /** - * See [Loan.debitAccount]. - */ - fun setDebitAccount(debitAccount: Boolean?) = apply { this.debitAccount = debitAccount } - - /** - * See [Loan.IBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setIBAN(IBAN: String?) = apply { this.IBAN = IBAN } - - /** - * See [Loan.BBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setBBAN(BBAN: String?) = apply { this.BBAN = BBAN } - - /** - * See [Loan.unMaskableAttributes]. - */ - fun setUnMaskableAttributes(unMaskableAttributes: Set?) = - apply { this.unMaskableAttributes = unMaskableAttributes } - - /** - * See [Loan.id]. - */ - fun setId(id: String?) = apply { this.id = id } - - /** - * See [Loan.name]. - */ - fun setName(name: String?) = apply { this.name = name } - - /** - * See [Loan.externalTransferAllowed]. - */ - fun setExternalTransferAllowed(externalTransferAllowed: Boolean?) = - apply { this.externalTransferAllowed = externalTransferAllowed } - - /** - * See [Loan.crossCurrencyAllowed]. - */ - fun setCrossCurrencyAllowed(crossCurrencyAllowed: Boolean?) = - apply { this.crossCurrencyAllowed = crossCurrencyAllowed } - - /** - * See [Loan.productKindName]. - */ - fun setProductKindName(productKindName: String?) = apply { this.productKindName = productKindName } - - /** - * See [Loan.productTypeName]. - */ - fun setProductTypeName(productTypeName: String?) = apply { this.productTypeName = productTypeName } - - /** - * See [Loan.bankAlias]. - */ - fun setBankAlias(bankAlias: String?) = apply { this.bankAlias = bankAlias } - - /** - * See [Loan.sourceId]. - */ - fun setSourceId(sourceId: String?) = apply { this.sourceId = sourceId } - - /** - * See [Loan.accountOpeningDate]. - */ - fun setAccountOpeningDate(accountOpeningDate: OffsetDateTime?) = - apply { this.accountOpeningDate = accountOpeningDate } - - /** - * See [Loan.lastUpdateDate]. - */ - fun setLastUpdateDate(lastUpdateDate: OffsetDateTime?) = - apply { this.lastUpdateDate = lastUpdateDate } - - /** - * See [Loan.userPreferences]. - */ - fun setUserPreferences(userPreferences: UserPreferences?) = apply { this.userPreferences = userPreferences } - - /** - * See [Loan.state]. - */ - fun setState(state: ProductState?) = apply { this.state = state } - - /** - * See [Loan.parentId]. - */ - fun setParentId(parentId: String?) = apply { this.parentId = parentId } - - /** - * See [Loan.financialInstitutionId]. - */ - fun setFinancialInstitutionId(financialInstitutionId: Long?) = - apply { this.financialInstitutionId = financialInstitutionId } - - /** - * See [Loan.subArrangements]. - */ - fun setSubArrangements(subArrangements: List?) = apply { - this.subArrangements = subArrangements - } - - /** - * See [Loan.lastSyncDate]. - */ - fun setLastSyncDate(lastSyncDate: OffsetDateTime?) = apply { this.lastSyncDate = lastSyncDate } - - /** - * See [Loan.additions]. - */ - fun setAdditions(additions: Map?) = - apply { this.additions = additions } - - /** - * See [Loan.displayName]. - */ - fun setDisplayName(displayName: String?) = - apply { this.displayName = displayName } - - /** - * See [Loan.cardDetails]. - */ - fun setCardDetails(cardDetails: CardDetails?) = - apply { this.cardDetails = cardDetails } - - /** - * See [Loan.reservedAmount]. - */ - fun setReservedAmount(reservedAmount: BigDecimal?) = - apply { this.reservedAmount = reservedAmount } - - /** - * See [Loan.remainingPeriodicTransfers]. - */ - fun setRemainingPeriodicTransfers(remainingPeriodicTransfers: BigDecimal?) = - apply { this.remainingPeriodicTransfers = remainingPeriodicTransfers } - - /** - * See [Loan.nextClosingDate]. - */ - fun setNextClosingDate(nextClosingDate: LocalDate?) = - apply { this.nextClosingDate = nextClosingDate } - - /** - * See [Loan.overdueSince]. - */ - fun setOverdueSince(overdueSince: LocalDate?) = - apply { this.overdueSince = overdueSince } - - /** - * See [Loan.externalAccountStatus]. - */ - fun setExternalAccountStatus(externalAccountStatus: String?) = - apply { this.externalAccountStatus = externalAccountStatus } - - /** - * See [Loan.interestDetails]. - */ - fun setInterestDetails(interestDetails: InterestDetails?) = - apply { this.interestDetails = interestDetails } - - /** - * See [Loan.bankBranchCode]. - */ - fun setBankBranchCode(bankBranchCode: String?) = apply { - this.bankBranchCode = bankBranchCode - } - - /** - * See [Loan.bankBranchCode2]. - */ - fun setBankBranchCode2(bankBranchCode2: String?) = apply { - this.bankBranchCode2 = bankBranchCode2 - } - - /** - * See [Loan.availableBalance]. - */ - fun setAvailableBalance(availableBalance: String?) = apply { this.availableBalance = availableBalance } - - /** - * See [Loan.creditLimit]. - */ - fun setCreditLimit(creditLimit: String?) = apply { this.creditLimit = creditLimit } - - /** - * See [Loan.minimumPayment]. - */ - fun setMinimumPayment(minimumPayment: BigDecimal?) = apply { this.minimumPayment = minimumPayment } - - /** - * See [Loan.minimumPaymentDueDate]. - */ - fun setMinimumPaymentDueDate(minimumPaymentDueDate: OffsetDateTime?) = - apply { this.minimumPaymentDueDate = minimumPaymentDueDate } - - /** - * Builds an instance of [Loan]. - */ - fun build() = Loan( - bookedBalance = bookedBalance, - principalAmount = principalAmount, - currency = currency, - urgentTransferAllowed = urgentTransferAllowed, - productNumber = productNumber, - accountInterestRate = accountInterestRate, - termUnit = termUnit, - termNumber = termNumber, - outstandingPrincipalAmount = outstandingPrincipalAmount, - monthlyInstalmentAmount = monthlyInstalmentAmount, - amountInArrear = amountInArrear, - interestSettlementAccount = interestSettlementAccount, - accruedInterest = accruedInterest, - accountHolderNames = accountHolderNames, - maturityDate = maturityDate, - valueDateBalance = valueDateBalance, - creditAccount = creditAccount, - debitAccount = debitAccount, - IBAN = IBAN, - BBAN = BBAN, - unMaskableAttributes = unMaskableAttributes, - id = id, - name = name, - externalTransferAllowed = externalTransferAllowed, - crossCurrencyAllowed = crossCurrencyAllowed, - productKindName = productKindName, - productTypeName = productTypeName, - bankAlias = bankAlias, - sourceId = sourceId, - accountOpeningDate = accountOpeningDate, - lastUpdateDate = lastUpdateDate, - userPreferences = userPreferences, - state = state, - parentId = parentId, - financialInstitutionId = financialInstitutionId, - subArrangements = subArrangements, - lastSyncDate = lastSyncDate, - additions = additions, - displayName = displayName, - cardDetails = cardDetails, - interestDetails = interestDetails, - reservedAmount = reservedAmount, - remainingPeriodicTransfers = remainingPeriodicTransfers, - nextClosingDate = nextClosingDate, - overdueSince = overdueSince, - externalAccountStatus = externalAccountStatus, - bankBranchCode = bankBranchCode, - bankBranchCode2 = bankBranchCode2, - availableBalance = availableBalance, - creditLimit = creditLimit, - minimumPayment = minimumPayment, - minimumPaymentDueDate = minimumPaymentDueDate, - ) - } -} - -/** - * Builds an instance of [Loan] with the [initializer] parameters. - */ -@Suppress("FunctionName") // DSL initializer -fun Loan(initializer: Loan.Builder.() -> Unit): Loan { - return Loan.Builder().apply(initializer).build() -} diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/loan/Loans.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/loan/Loans.kt deleted file mode 100644 index 8439ff29..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/loan/Loans.kt +++ /dev/null @@ -1,110 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.loan - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.common.AggregatedBalance -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param products The list of loans. - * @param displayName The label/name of a Loan used to display on screen. - * @param aggregatedBalance The aggregated balance of this group of products. - * @param additions Extra parameters - */ -@Poko -@Parcelize -class Loans private constructor( - val products: List, - val name: String?, - val displayName: String?, - val aggregatedBalance: AggregatedBalance?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [Loans.products] - */ - var products: List? = null - - /** - * See [Loans.name] - */ - var name: String? = null - - /** - * See [Loans.displayName] - */ - var displayName: String? = null - - /** - * See [Loans.aggregatedBalance] - */ - var aggregatedBalance: AggregatedBalance? = null - - /** - * See [Loans.additions] - */ - var additions: Map? = null - - /** - * See [Loans.products] - */ - fun setProducts(products: List) = apply { - this.products = products - } - - /** - * See [Loans.name] - */ - fun setName(name: String?) = apply { - this.name = name - } - - /** - * See [Loans.displayName] - */ - fun setDisplayName(displayName: String?) = apply { - this.displayName = displayName - } - - /** - * See [Loans.aggregatedBalance] - */ - fun setAggregatedBalance(aggregatedBalance: AggregatedBalance?) = apply { - this.aggregatedBalance = aggregatedBalance - } - - /** - * See [Loans.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Builds an instance of [Loans] - */ - fun build() = Loans( - requireNotNull(products), - name, - displayName, - aggregatedBalance, - additions - ) - } -} - -/** - * DSL to create [Loans] - */ -fun Loans(block: Loans.Builder.() -> Unit) = Loans.Builder().apply(block).build() - -internal fun Loans?.allProducts(): List = this?.products ?: emptyList() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/savings_accounts/SavingsAccount.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/savings_accounts/SavingsAccount.kt deleted file mode 100644 index f9ae1f38..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/savings_accounts/SavingsAccount.kt +++ /dev/null @@ -1,852 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.savings_accounts - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import com.backbase.accounts_journey.domain.model.common.BaseProduct -import com.backbase.accounts_journey.domain.model.common.CardDetails -import com.backbase.accounts_journey.domain.model.common.InterestDetails -import com.backbase.accounts_journey.domain.model.common.ProductState -import com.backbase.accounts_journey.domain.model.common.TimeUnit -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal -import java.time.LocalDate - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param bookedBalance - * @param availableBalance - * @param accruedInterest - * @param IBAN The International Bank Account Number. If specified, it must be a valid IBAN, otherwise an invalid value error could be raised. - * @param BBAN Specifying the BBAN of the account - BBAN is short for Basic Bank Account Number. It represents a country-specific bank account number. - * @param BIC Bank Identifier Code - international bank code that identifies particular banks worldwide - * @param unMaskableAttributes An optional list of the maskable attributes that can be unmasked. - * @param currency The alpha-3 code (complying with ISO 4217) of the currency that qualifies the amount. - * @param urgentTransferAllowed Defines if urgent transfer is allowed. - * @param bankBranchCode (This is to accomodate additional country specific fields like Sort Code in UK) - * @param bankBranchCode2 (This is to accomodate additional country specific fields fedwire Routing Nmber) - * @param accountInterestRate The annualized cost of credit or debt-capital computed as the percentage ratio of interest to the principal. - * @param minimumRequiredBalance Minimum amount that a customer must have in an account in order to receive some sort of service, such as keeping the account open or receive interest. - * @param startDate - * @param termUnit - * @param termNumber The number of times interest rate is paid on the settlement account. - * @param maturityDate End term of a holding period. - * @param maturityAmount Amount payable at the end of a holding period of a product (maturity date). For deposit all of the interest is usualy paid at maturity date (IF the term is shorter then one year). - * @param autoRenewalIndicator Indicates whether or not an arrangement is to be continued after maturity automatically. Usually the product is renewed using the same principal and term unless renegotiation has taken place prior to expiration. - * @param interestPaymentFrequencyUnit - * @param interestPaymentFrequencyNumber - * @param principalAmount - * @param interestSettlementAccount Account that provides quick access to accumulated cash to facilitate daily settlements with other businesses. - * @param accountHolderNames Party(s) with a relationship to the account. - * @param valueDateBalance The balance of the account on a specific date that needs to be used for the calculation of interest. NB! If no date is specified (like for the book date balance) the current date can be assumed. - * @param accountHolderAddressLine1 Address of the Payer/Payee - Alternate address line for the account. - * @param accountHolderAddressLine2 Address of the Payer/Payee - Alternate address line for the account. - * @param accountHolderStreetName Street name of the Payer/Payee - Alternate street name for the account. - * @param town Town of the Payer/Payee - Alternate town for the account. - * @param postCode - * @param countrySubDivision - * @param accountHolderCountry Country of the account holder - * @param creditAccount Indicator whether or not the arrangement can be used in payment orders as credit account. - * @param debitAccount Indicator whether or not the arrangement can be used in payment orders as debit account. - * @param id Reference to the product of which the arrangement is an instantiation. - * @param name - * @param externalTransferAllowed Defines if transfer to another party is allowed. - * @param crossCurrencyAllowed Defines if cross currency transfer is allowed - * @param productKindName The label/name that is used for the respective product kind - * @param productTypeName The label/name that is used to label a specific product type - * @param bankAlias The name that can be assigned by the bank to label the arrangement. - * @param sourceId Indicate if the account is regular or external - * @param accountOpeningDate - * @param lastUpdateDate Last date of parameter update for the arrangement. - * @param userPreferences The preferences configured by the user. - * @param state - * @param parentId Reference to the parent of the arrangement. - * @param subArrangements A list of arrangements whose parent is this product. - * @param financialInstitutionId Financial institution ID - * @param lastSyncDate Last synchronization datetime - * @param additions Extra parameters - * @param displayName name of the particular product - * @param cardDetails - * @param interestDetails - * @param reservedAmount The reservation of a portion of a credit or debit balance for the cost of services not yet rendered. - * @param remainingPeriodicTransfers The limitation in periodic saving transfers or withdrawals. In the case of the US, Regulation D enables for a maximum of 6 monthly savings transfers or withdrawals. - * @param nextClosingDate The last day of the forthcoming billing cycle. - * @param overdueSince The date in which the arrangement has been overdue since. - * @param externalAccountStatus Synchronization statuses an account can have on the provider side after it has been aggregated. - */ -@Suppress("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class SavingsAccount internal constructor( - val bookedBalance: String?, - val availableBalance: String?, - val accruedInterest: BigDecimal?, - @SuppressWarnings("ConstructorParameterNaming") val IBAN: String?, - @SuppressWarnings("ConstructorParameterNaming") val BBAN: String?, - @SuppressWarnings("ConstructorParameterNaming") val BIC: String?, - val unMaskableAttributes: Set?, - val currency: String?, - val urgentTransferAllowed: Boolean?, - val bankBranchCode: String?, - val bankBranchCode2: String?, - val accountInterestRate: BigDecimal?, - val minimumRequiredBalance: BigDecimal?, - val startDate: java.time.OffsetDateTime?, - val termUnit: TimeUnit?, - val termNumber: BigDecimal?, - val maturityDate: java.time.OffsetDateTime?, - val maturityAmount: BigDecimal?, - val autoRenewalIndicator: Boolean?, - val interestPaymentFrequencyUnit: TimeUnit?, - val interestPaymentFrequencyNumber: BigDecimal?, - val principalAmount: BigDecimal?, - val interestSettlementAccount: String?, - val accountHolderNames: String?, - val valueDateBalance: BigDecimal?, - val accountHolderAddressLine1: String?, - val accountHolderAddressLine2: String?, - val accountHolderStreetName: String?, - val town: String?, - val postCode: String?, - val countrySubDivision: String?, - val accountHolderCountry: String?, - val creditAccount: Boolean?, - val debitAccount: Boolean?, - val id: String?, - val name: String?, - val externalTransferAllowed: Boolean?, - val crossCurrencyAllowed: Boolean?, - val productKindName: String?, - val productTypeName: String?, - val bankAlias: String?, - val sourceId: String?, - val accountOpeningDate: java.time.OffsetDateTime?, - val lastUpdateDate: java.time.OffsetDateTime?, - val userPreferences: UserPreferences?, - val state: ProductState?, - val parentId: String?, - val subArrangements: List?, - val financialInstitutionId: Long?, - val lastSyncDate: java.time.OffsetDateTime?, - val additions: Map?, - val displayName: String?, - val cardDetails: CardDetails?, - val interestDetails: InterestDetails?, - val reservedAmount: BigDecimal?, - val remainingPeriodicTransfers: BigDecimal?, - val nextClosingDate: LocalDate?, - val overdueSince: LocalDate?, - val externalAccountStatus: String?, -) : Parcelable { - - /** - * A builder for [SavingsAccount]. - */ - class Builder { - - /** - * See [SavingsAccount.bookedBalance]. - */ - var bookedBalance: String? = null - - /** - * See [SavingsAccount.availableBalance]. - */ - var availableBalance: String? = null - - /** - * See [SavingsAccount.accruedInterest]. - */ - var accruedInterest: BigDecimal? = null - - /** - * See [SavingsAccount.IBAN]. - */ - @SuppressWarnings("VariableNaming") - var IBAN: String? = null - - /** - * See [SavingsAccount.BBAN]. - */ - @SuppressWarnings("VariableNaming") - var BBAN: String? = null - - /** - * See [SavingsAccount.BIC]. - */ - @SuppressWarnings("VariableNaming") - var BIC: String? = null - - /** - * See [SavingsAccount.unMaskableAttributes]. - */ - var unMaskableAttributes: Set? = null - - /** - * See [SavingsAccount.currency]. - */ - var currency: String? = null - - /** - * See [SavingsAccount.urgentTransferAllowed]. - */ - var urgentTransferAllowed: Boolean? = null - - /** - * See [SavingsAccount.bankBranchCode]. - */ - var bankBranchCode: String? = null - - /** - * See [SavingsAccount.bankBranchCode2]. - */ - var bankBranchCode2: String? = null - - /** - * See [SavingsAccount.accountInterestRate]. - */ - var accountInterestRate: BigDecimal? = null - - /** - * See [SavingsAccount.minimumRequiredBalance]. - */ - var minimumRequiredBalance: BigDecimal? = null - - /** - * See [SavingsAccount.startDate]. - */ - var startDate: java.time.OffsetDateTime? = null - - /** - * See [SavingsAccount.termUnit]. - */ - var termUnit: TimeUnit? = null - - /** - * See [SavingsAccount.termNumber]. - */ - var termNumber: BigDecimal? = null - - /** - * See [SavingsAccount.maturityDate]. - */ - var maturityDate: java.time.OffsetDateTime? = null - - /** - * See [SavingsAccount.maturityAmount]. - */ - var maturityAmount: BigDecimal? = null - - /** - * See [SavingsAccount.autoRenewalIndicator]. - */ - var autoRenewalIndicator: Boolean? = null - - /** - * See [SavingsAccount.interestPaymentFrequencyUnit]. - */ - var interestPaymentFrequencyUnit: TimeUnit? = null - - /** - * See [SavingsAccount.interestPaymentFrequencyNumber]. - */ - var interestPaymentFrequencyNumber: BigDecimal? = null - - /** - * See [SavingsAccount.principalAmount]. - */ - var principalAmount: BigDecimal? = null - - /** - * See [SavingsAccount.interestSettlementAccount]. - */ - var interestSettlementAccount: String? = null - - /** - * See [SavingsAccount.accountHolderNames]. - */ - var accountHolderNames: String? = null - - /** - * See [SavingsAccount.valueDateBalance]. - */ - var valueDateBalance: BigDecimal? = null - - /** - * See [SavingsAccount.accountHolderAddressLine1]. - */ - var accountHolderAddressLine1: String? = null - - /** - * See [SavingsAccount.accountHolderAddressLine2]. - */ - var accountHolderAddressLine2: String? = null - - /** - * See [SavingsAccount.accountHolderStreetName]. - */ - var accountHolderStreetName: String? = null - - /** - * See [SavingsAccount.town]. - */ - var town: String? = null - - /** - * See [SavingsAccount.postCode]. - */ - var postCode: String? = null - - /** - * See [SavingsAccount.countrySubDivision]. - */ - var countrySubDivision: String? = null - - /** - * See [SavingsAccount.accountHolderCountry]. - */ - var accountHolderCountry: String? = null - - /** - * See [SavingsAccount.creditAccount]. - */ - var creditAccount: Boolean? = null - - /** - * See [SavingsAccount.debitAccount]. - */ - var debitAccount: Boolean? = null - - /** - * See [SavingsAccount.id]. - */ - var id: String? = null - - /** - * See [SavingsAccount.name]. - */ - var name: String? = null - - /** - * See [SavingsAccount.externalTransferAllowed]. - */ - var externalTransferAllowed: Boolean? = null - - /** - * See [SavingsAccount.crossCurrencyAllowed]. - */ - var crossCurrencyAllowed: Boolean? = null - - /** - * See [SavingsAccount.productKindName]. - */ - var productKindName: String? = null - - /** - * See [SavingsAccount.productTypeName]. - */ - var productTypeName: String? = null - - /** - * See [SavingsAccount.bankAlias]. - */ - var bankAlias: String? = null - - /** - * See [SavingsAccount.sourceId]. - */ - var sourceId: String? = null - - /** - * See [SavingsAccount.accountOpeningDate]. - */ - var accountOpeningDate: java.time.OffsetDateTime? = null - - /** - * See [SavingsAccount.lastUpdateDate]. - */ - var lastUpdateDate: java.time.OffsetDateTime? = null - - /** - * See [SavingsAccount.userPreferences]. - */ - var userPreferences: UserPreferences? = null - - /** - * See [SavingsAccount.state]. - */ - var state: ProductState? = null - - /** - * See [SavingsAccount.parentId]. - */ - var parentId: String? = null - - /** - * See [SavingsAccount.subArrangements]. - */ - var subArrangements: List? = null - - /** - * See [SavingsAccount.financialInstitutionId]. - */ - var financialInstitutionId: Long? = null - - /** - * See [SavingsAccount.lastSyncDate]. - */ - var lastSyncDate: java.time.OffsetDateTime? = null - - /** - * See [SavingsAccount.additions]. - */ - var additions: Map? = null - - /** - * See [SavingsAccount.displayName]. - */ - var displayName: String? = null - - /** - * See [SavingsAccount.cardDetails]. - */ - var cardDetails: CardDetails? = null - - /** - * See [SavingsAccount.interestDetails]. - */ - var interestDetails: InterestDetails? = null - - /** - * See [SavingsAccount.reservedAmount]. - */ - var reservedAmount: BigDecimal? = null - - /** - * See [SavingsAccount.remainingPeriodicTransfers]. - */ - var remainingPeriodicTransfers: BigDecimal? = null - - /** - * See [SavingsAccount.nextClosingDate]. - */ - var nextClosingDate: LocalDate? = null - - /** - * See [SavingsAccount.overdueSince]. - */ - var overdueSince: LocalDate? = null - - /** - * See [SavingsAccount.externalAccountStatus]. - */ - var externalAccountStatus: String? = null - - /** - * See [SavingsAccount.bookedBalance]. - */ - fun setBookedBalance(bookedBalance: String?) = apply { this.bookedBalance = bookedBalance } - - /** - * See [SavingsAccount.availableBalance]. - */ - fun setAvailableBalance(availableBalance: String?) = apply { this.availableBalance = availableBalance } - - /** - * See [SavingsAccount.accruedInterest]. - */ - fun setAccruedInterest(accruedInterest: BigDecimal?) = - apply { this.accruedInterest = accruedInterest } - - /** - * See [SavingsAccount.IBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setIBAN(IBAN: String?) = apply { this.IBAN = IBAN } - - /** - * See [SavingsAccount.BBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setBBAN(BBAN: String?) = apply { this.BBAN = BBAN } - - /** - * See [SavingsAccount.BIC]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setBIC(BIC: String?) = apply { this.BIC = BIC } - - /** - * See [SavingsAccount.unMaskableAttributes]. - */ - fun setUnMaskableAttributes(unMaskableAttributes: Set?) = - apply { this.unMaskableAttributes = unMaskableAttributes } - - /** - * See [SavingsAccount.currency]. - */ - fun setCurrency(currency: String?) = apply { this.currency = currency } - - /** - * See [SavingsAccount.urgentTransferAllowed]. - */ - fun setUrgentTransferAllowed(urgentTransferAllowed: Boolean?) = - apply { this.urgentTransferAllowed = urgentTransferAllowed } - - /** - * See [SavingsAccount.bankBranchCode]. - */ - fun setBankBranchCode(bankBranchCode: String?) = apply { this.bankBranchCode = bankBranchCode } - - /** - * See [SavingsAccount.bankBranchCode2]. - */ - fun setBankBranchCode2(bankBranchCode2: String?) = apply { this.bankBranchCode2 = bankBranchCode2 } - - /** - * See [SavingsAccount.accountInterestRate]. - */ - fun setAccountInterestRate(accountInterestRate: BigDecimal?) = - apply { this.accountInterestRate = accountInterestRate } - - /** - * See [SavingsAccount.minimumRequiredBalance]. - */ - fun setMinimumRequiredBalance(minimumRequiredBalance: BigDecimal?) = - apply { this.minimumRequiredBalance = minimumRequiredBalance } - - /** - * See [SavingsAccount.startDate]. - */ - fun setStartDate(startDate: java.time.OffsetDateTime?) = apply { this.startDate = startDate } - - /** - * See [SavingsAccount.termUnit]. - */ - fun setTermUnit(termUnit: TimeUnit?) = apply { this.termUnit = termUnit } - - /** - * See [SavingsAccount.termNumber]. - */ - fun setTermNumber(termNumber: BigDecimal?) = apply { this.termNumber = termNumber } - - /** - * See [SavingsAccount.maturityDate]. - */ - fun setMaturityDate(maturityDate: java.time.OffsetDateTime?) = apply { this.maturityDate = maturityDate } - - /** - * See [SavingsAccount.maturityAmount]. - */ - fun setMaturityAmount(maturityAmount: BigDecimal?) = apply { this.maturityAmount = maturityAmount } - - /** - * See [SavingsAccount.autoRenewalIndicator]. - */ - fun setAutoRenewalIndicator(autoRenewalIndicator: Boolean?) = - apply { this.autoRenewalIndicator = autoRenewalIndicator } - - /** - * See [SavingsAccount.interestPaymentFrequencyUnit]. - */ - fun setInterestPaymentFrequencyUnit(interestPaymentFrequencyUnit: TimeUnit?) = - apply { this.interestPaymentFrequencyUnit = interestPaymentFrequencyUnit } - - /** - * See [SavingsAccount.interestPaymentFrequencyNumber]. - */ - fun setInterestPaymentFrequencyNumber(interestPaymentFrequencyNumber: BigDecimal?) = - apply { this.interestPaymentFrequencyNumber = interestPaymentFrequencyNumber } - - /** - * See [SavingsAccount.principalAmount]. - */ - fun setPrincipalAmount(principalAmount: BigDecimal?) = - apply { this.principalAmount = principalAmount } - - /** - * See [SavingsAccount.interestSettlementAccount]. - */ - fun setInterestSettlementAccount(interestSettlementAccount: String?) = - apply { this.interestSettlementAccount = interestSettlementAccount } - - /** - * See [SavingsAccount.accountHolderNames]. - */ - fun setAccountHolderNames(accountHolderNames: String?) = - apply { this.accountHolderNames = accountHolderNames } - - /** - * See [SavingsAccount.valueDateBalance]. - */ - fun setValueDateBalance(valueDateBalance: BigDecimal?) = - apply { this.valueDateBalance = valueDateBalance } - - /** - * See [SavingsAccount.accountHolderAddressLine1]. - */ - fun setAccountHolderAddressLine1(accountHolderAddressLine1: String?) = - apply { this.accountHolderAddressLine1 = accountHolderAddressLine1 } - - /** - * See [SavingsAccount.accountHolderAddressLine2]. - */ - fun setAccountHolderAddressLine2(accountHolderAddressLine2: String?) = - apply { this.accountHolderAddressLine2 = accountHolderAddressLine2 } - - /** - * See [SavingsAccount.accountHolderStreetName]. - */ - fun setAccountHolderStreetName(accountHolderStreetName: String?) = - apply { this.accountHolderStreetName = accountHolderStreetName } - - /** - * See [SavingsAccount.town]. - */ - fun setTown(town: String?) = apply { this.town = town } - - /** - * See [SavingsAccount.postCode]. - */ - fun setPostCode(postCode: String?) = apply { this.postCode = postCode } - - /** - * See [SavingsAccount.countrySubDivision]. - */ - fun setCountrySubDivision(countrySubDivision: String?) = - apply { this.countrySubDivision = countrySubDivision } - - /** - * See [SavingsAccount.accountHolderCountry]. - */ - fun setAccountHolderCountry(accountHolderCountry: String?) = - apply { this.accountHolderCountry = accountHolderCountry } - - /** - * See [SavingsAccount.creditAccount]. - */ - fun setCreditAccount(creditAccount: Boolean?) = apply { this.creditAccount = creditAccount } - - /** - * See [SavingsAccount.debitAccount]. - */ - fun setDebitAccount(debitAccount: Boolean?) = apply { this.debitAccount = debitAccount } - - /** - * See [SavingsAccount.id]. - */ - fun setId(id: String?) = apply { this.id = id } - - /** - * See [SavingsAccount.name]. - */ - fun setName(name: String?) = apply { this.name = name } - - /** - * See [SavingsAccount.externalTransferAllowed]. - */ - fun setExternalTransferAllowed(externalTransferAllowed: Boolean?) = - apply { this.externalTransferAllowed = externalTransferAllowed } - - /** - * See [SavingsAccount.crossCurrencyAllowed]. - */ - fun setCrossCurrencyAllowed(crossCurrencyAllowed: Boolean?) = - apply { this.crossCurrencyAllowed = crossCurrencyAllowed } - - /** - * See [SavingsAccount.productKindName]. - */ - fun setProductKindName(productKindName: String?) = apply { this.productKindName = productKindName } - - /** - * See [SavingsAccount.productTypeName]. - */ - fun setProductTypeName(productTypeName: String?) = apply { this.productTypeName = productTypeName } - - /** - * See [SavingsAccount.bankAlias]. - */ - fun setBankAlias(bankAlias: String?) = apply { this.bankAlias = bankAlias } - - /** - * See [SavingsAccount.sourceId]. - */ - fun setSourceId(sourceId: String?) = apply { this.sourceId = sourceId } - - /** - * See [SavingsAccount.accountOpeningDate]. - */ - fun setAccountOpeningDate(accountOpeningDate: java.time.OffsetDateTime?) = - apply { this.accountOpeningDate = accountOpeningDate } - - /** - * See [SavingsAccount.lastUpdateDate]. - */ - fun setLastUpdateDate(lastUpdateDate: java.time.OffsetDateTime?) = - apply { this.lastUpdateDate = lastUpdateDate } - - /** - * See [SavingsAccount.userPreferences]. - */ - fun setUserPreferences(userPreferences: UserPreferences?) = apply { this.userPreferences = userPreferences } - - /** - * See [SavingsAccount.state]. - */ - fun setState(state: ProductState?) = apply { this.state = state } - - /** - * See [SavingsAccount.parentId]. - */ - fun setParentId(parentId: String?) = apply { this.parentId = parentId } - - /** - * See [SavingsAccount.subArrangements]. - */ - fun setSubArrangements(subArrangements: List?) = apply { - this.subArrangements = subArrangements - } - - /** - * See [SavingsAccount.financialInstitutionId]. - */ - fun setFinancialInstitutionId(financialInstitutionId: Long?) = - apply { this.financialInstitutionId = financialInstitutionId } - - /** - * See [SavingsAccount.lastSyncDate]. - */ - fun setLastSyncDate(lastSyncDate: java.time.OffsetDateTime?) = apply { this.lastSyncDate = lastSyncDate } - - /** - * See [SavingsAccount.additions]. - */ - fun setAdditions(additions: Map?) = - apply { this.additions = additions } - - /** - * See [SavingsAccount.displayName]. - */ - fun setDisplayName(displayName: String?) = - apply { this.displayName = displayName } - - /** - * See [SavingsAccount.cardDetails]. - */ - fun setCardDetails(cardDetails: CardDetails?) = - apply { this.cardDetails = cardDetails } - - /** - * See [SavingsAccount.reservedAmount]. - */ - fun setReservedAmount(reservedAmount: BigDecimal?) = - apply { this.reservedAmount = reservedAmount } - - /** - * See [SavingsAccount.remainingPeriodicTransfers]. - */ - fun setRemainingPeriodicTransfers(remainingPeriodicTransfers: BigDecimal?) = - apply { this.remainingPeriodicTransfers = remainingPeriodicTransfers } - - /** - * See [SavingsAccount.nextClosingDate]. - */ - fun setNextClosingDate(nextClosingDate: LocalDate?) = - apply { this.nextClosingDate = nextClosingDate } - - /** - * See [SavingsAccount.overdueSince]. - */ - fun setOverdueSince(overdueSince: LocalDate?) = - apply { this.overdueSince = overdueSince } - - /** - * See [SavingsAccount.externalAccountStatus]. - */ - fun setExternalAccountStatus(externalAccountStatus: String?) = - apply { this.externalAccountStatus = externalAccountStatus } - - /** - * See [SavingsAccount.interestDetails]. - */ - fun setInterestDetails(interestDetails: InterestDetails?) = - apply { this.interestDetails = interestDetails } - - /** - * Builds an instance of [SavingsAccount]. - */ - @Suppress("LongMethod") - fun build() = SavingsAccount( - bookedBalance = bookedBalance, - availableBalance = availableBalance, - accruedInterest = accruedInterest, - IBAN = IBAN, - BBAN = BBAN, - BIC = BIC, - unMaskableAttributes = unMaskableAttributes, - currency = currency, - urgentTransferAllowed = urgentTransferAllowed, - bankBranchCode = bankBranchCode, - bankBranchCode2 = bankBranchCode2, - accountInterestRate = accountInterestRate, - minimumRequiredBalance = minimumRequiredBalance, - startDate = startDate, - termUnit = termUnit, - termNumber = termNumber, - maturityDate = maturityDate, - maturityAmount = maturityAmount, - autoRenewalIndicator = autoRenewalIndicator, - interestPaymentFrequencyUnit = interestPaymentFrequencyUnit, - interestPaymentFrequencyNumber = interestPaymentFrequencyNumber, - principalAmount = principalAmount, - interestSettlementAccount = interestSettlementAccount, - accountHolderNames = accountHolderNames, - valueDateBalance = valueDateBalance, - accountHolderAddressLine1 = accountHolderAddressLine1, - accountHolderAddressLine2 = accountHolderAddressLine2, - accountHolderStreetName = accountHolderStreetName, - town = town, - postCode = postCode, - countrySubDivision = countrySubDivision, - accountHolderCountry = accountHolderCountry, - creditAccount = creditAccount, - debitAccount = debitAccount, - id = id, - name = name, - externalTransferAllowed = externalTransferAllowed, - crossCurrencyAllowed = crossCurrencyAllowed, - productKindName = productKindName, - productTypeName = productTypeName, - bankAlias = bankAlias, - sourceId = sourceId, - accountOpeningDate = accountOpeningDate, - lastUpdateDate = lastUpdateDate, - userPreferences = userPreferences, - state = state, - parentId = parentId, - subArrangements = subArrangements, - financialInstitutionId = financialInstitutionId, - lastSyncDate = lastSyncDate, - additions = additions, - displayName = displayName, - cardDetails = cardDetails, - interestDetails = interestDetails, - reservedAmount = reservedAmount, - remainingPeriodicTransfers = remainingPeriodicTransfers, - nextClosingDate = nextClosingDate, - overdueSince = overdueSince, - externalAccountStatus = externalAccountStatus, - ) - } -} - -/** - * Builds an instance of [SavingsAccount] with the [initializer] parameters. - */ -@Suppress("FunctionName") // DSL initializer -fun SavingsAccount(initializer: SavingsAccount.Builder.() -> Unit): SavingsAccount { - return SavingsAccount.Builder().apply(initializer).build() -} diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/savings_accounts/SavingsAccounts.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/savings_accounts/SavingsAccounts.kt deleted file mode 100644 index 00a2d58f..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/savings_accounts/SavingsAccounts.kt +++ /dev/null @@ -1,96 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.savings_accounts - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.common.AggregatedBalance -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param products List of savings accounts - * @param name the label/name of the saving account - * @param aggregatedBalance The aggregated balance of this group of products. - * @param additions Extra parameters - */ -@Poko -@Parcelize -class SavingsAccounts private constructor( - val products: List, - val name: String?, - val aggregatedBalance: AggregatedBalance?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [SavingsAccounts.products] - */ - var products: List? = null - - /** - * See [SavingsAccounts.name] - */ - var name: String? = null - - /** - * See [SavingsAccounts.aggregatedBalance] - */ - var aggregatedBalance: AggregatedBalance? = null - - /** - * See [SavingsAccounts.additions] - */ - var additions: Map? = null - - /** - * See [SavingsAccounts.products] - */ - fun setProducts(products: List) = apply { - this.products = products - } - - /** - * See [SavingsAccounts.name] - */ - fun setName(name: String?) = apply { - this.name = name - } - - /** - * See [SavingsAccounts.aggregatedBalance] - */ - fun setAggregatedBalance(aggregatedBalance: AggregatedBalance?) = apply { - this.aggregatedBalance = aggregatedBalance - } - - /** - * See [SavingsAccounts.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Builds an instance of [SavingsAccounts] - */ - fun build() = SavingsAccounts( - requireNotNull(products), - name, - aggregatedBalance, - additions - ) - } -} - -/** - * DSL to create [SavingsAccounts] - */ -fun SavingsAccounts(block: SavingsAccounts.Builder.() -> Unit) = SavingsAccounts.Builder().apply(block).build() - -internal fun SavingsAccounts?.allProducts(): List = this?.products ?: emptyList() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/term_deposits/TermDeposit.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/term_deposits/TermDeposit.kt deleted file mode 100644 index 2a429ef9..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/term_deposits/TermDeposit.kt +++ /dev/null @@ -1,820 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.term_deposits - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import com.backbase.accounts_journey.domain.model.common.BaseProduct -import com.backbase.accounts_journey.domain.model.common.CardDetails -import com.backbase.accounts_journey.domain.model.common.InterestDetails -import com.backbase.accounts_journey.domain.model.common.ProductState -import com.backbase.accounts_journey.domain.model.common.TimeUnit -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal -import java.time.LocalDate -import java.time.OffsetDateTime - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param bookedBalance - * @param principalAmount - * @param accruedInterest - * @param IBAN The International Bank Account Number. If specified, it must be a valid IBAN, otherwise an invalid value error could be raised. - * @param BBAN Specifying the BBAN of the account - BBAN is short for Basic Bank Account Number. It represents a country-specific bank account number. - * @param unMaskableAttributes An optional list of the maskable attributes that can be unmasked. - * @param currency The alpha-3 code (complying with ISO 4217) of the currency that qualifies the amount. - * @param urgentTransferAllowed Defines if urgent transfer is allowed. - * @param productNumber The number identifying the contract. - * @param accountInterestRate The annualized cost of credit or debt-capital computed as the percentage ratio of interest to the principal. - * @param startDate - * @param termUnit - * @param termNumber The number of times interest rate is paid on the settlement account. - * @param maturityDate End term of a holding period. - * @param maturityAmount Amount payable at the end of a holding period of a product (maturity date). For deposit all of the interest is usualy paid at maturity date (IF the term is shorter then one year). - * @param autoRenewalIndicator Indicates whether or not an arrangement is to be continued after maturity automatically. Usually the product is renewed using the same principal and term unless renegotiation has taken place prior to expiration. - * @param interestPaymentFrequencyUnit - * @param interestPaymentFrequencyNumber - * @param interestSettlementAccount Account that provides quick access to accumulated cash to facilitate daily settlements with other businesses. - * @param valueDateBalance The balance of the account on a specific date that needs to be used for the calculation of interest. NB! If no date is specified (like for the book date balance) the current date can be assumed. - * @param accountHolderNames Party(s) with a relationship to the account. - * @param outstandingPrincipalAmount This IS the value date balance of the arrangement. - * @param creditAccount Indicator whether or not the arrangement can be used in payment orders as credit account. - * @param debitAccount Indicator whether or not the arrangement can be used in payment orders as debit account. - * @param minimumRequiredBalance Minimum amount that a customer must have in an account in order to receive some sort of service, such as keeping the account open or receive interest. - * @param id Reference to the product of which the arrangement is an instantiation. - * @param name - * @param externalTransferAllowed Defines if transfer to another party is allowed. - * @param crossCurrencyAllowed Defines if cross currency transfer is allowed - * @param productKindName The label/name that is used for the respective product kind - * @param productTypeName The label/name that is used to label a specific product type - * @param bankAlias The name that can be assigned by the bank to label the arrangement. - * @param sourceId Indicate if the account is regular or external - * @param accountOpeningDate - * @param lastUpdateDate Last date of parameter update for the arrangement. - * @param userPreferences The preferences configured by the user. - * @param state - * @param subArrangements A list of arrangements whose parent is this product. - * @param parentId Reference to the parent of the arrangement. - * @param financialInstitutionId Financial institution ID - * @param lastSyncDate Last synchronization datetime - * @param additions Extra parameters - * @param displayName name of the particular product - * @param cardDetails - * @param interestDetails - * @param reservedAmount The reservation of a portion of a credit or debit balance for the cost of services not yet rendered. - * @param remainingPeriodicTransfers The limitation in periodic saving transfers or withdrawals. In the case of the US, Regulation D enables for a maximum of 6 monthly savings transfers or withdrawals. - * @param nextClosingDate The last day of the forthcoming billing cycle. - * @param overdueSince The date in which the arrangement has been overdue since. - * @param externalAccountStatus Synchronization statuses an account can have on the provider side after it has been aggregated. - * @param bankBranchCode (This is to accomodate additional country specific fields like Sort Code in UK) - * @param bankBranchCode2 (This is to accomodate additional country specific fields fedwire Routing Nmber) - * @param availableBalance - * @param creditLimit - * @param minimumPayment The minimum payment set a percentage of balance, or a fixed cash amount. - * @param minimumPaymentDueDate Minimum Payment Due Date shown on your monthly statement to remain in good standing. - */ -@SuppressWarnings("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class TermDeposit internal constructor( - val bookedBalance: String?, - val principalAmount: BigDecimal?, - val accruedInterest: BigDecimal?, - @SuppressWarnings("ConstructorParameterNaming") val IBAN: String?, - @SuppressWarnings("ConstructorParameterNaming") val BBAN: String?, - val unMaskableAttributes: Set?, - val currency: String?, - val urgentTransferAllowed: Boolean?, - val productNumber: String?, - val accountInterestRate: BigDecimal?, - val startDate: OffsetDateTime?, - val termUnit: TimeUnit?, - val termNumber: BigDecimal?, - val maturityDate: OffsetDateTime?, - val maturityAmount: BigDecimal?, - val autoRenewalIndicator: Boolean?, - val interestPaymentFrequencyUnit: TimeUnit?, - val interestPaymentFrequencyNumber: BigDecimal?, - val interestSettlementAccount: String?, - val valueDateBalance: BigDecimal?, - val accountHolderNames: String?, - val outstandingPrincipalAmount: BigDecimal?, - val creditAccount: Boolean?, - val debitAccount: Boolean?, - val minimumRequiredBalance: BigDecimal?, - val id: String?, - val name: String?, - val externalTransferAllowed: Boolean?, - val crossCurrencyAllowed: Boolean?, - val productKindName: String?, - val productTypeName: String?, - val bankAlias: String?, - val sourceId: String?, - val accountOpeningDate: OffsetDateTime?, - val lastUpdateDate: OffsetDateTime?, - val userPreferences: UserPreferences?, - val state: ProductState?, - val subArrangements: List?, - val parentId: String?, - val financialInstitutionId: Long?, - val lastSyncDate: OffsetDateTime?, - val additions: Map?, - val displayName: String?, - val cardDetails: CardDetails?, - val interestDetails: InterestDetails?, - val reservedAmount: BigDecimal?, - val remainingPeriodicTransfers: BigDecimal?, - val nextClosingDate: LocalDate?, - val overdueSince: LocalDate?, - val externalAccountStatus: String?, - val bankBranchCode: String?, - val bankBranchCode2: String?, - val availableBalance: String?, - val creditLimit: String?, - val minimumPayment: BigDecimal?, - val minimumPaymentDueDate: OffsetDateTime?, -) : Parcelable { - - /** - * A builder for [TermDeposit]. - */ - class Builder { - - /** - * See [TermDeposit.bookedBalance]. - */ - var bookedBalance: String? = null - - /** - * See [TermDeposit.principalAmount]. - */ - var principalAmount: BigDecimal? = null - - /** - * See [TermDeposit.accruedInterest]. - */ - var accruedInterest: BigDecimal? = null - - /** - * See [TermDeposit.IBAN]. - */ - @SuppressWarnings("VariableNaming") - var IBAN: String? = null - - /** - * See [TermDeposit.BBAN]. - */ - @SuppressWarnings("VariableNaming") - var BBAN: String? = null - - /** - * See [TermDeposit.unMaskableAttributes]. - */ - var unMaskableAttributes: Set? = null - - /** - * See [TermDeposit.currency]. - */ - var currency: String? = null - - /** - * See [TermDeposit.urgentTransferAllowed]. - */ - var urgentTransferAllowed: Boolean? = null - - /** - * See [TermDeposit.productNumber]. - */ - var productNumber: String? = null - - /** - * See [TermDeposit.accountInterestRate]. - */ - var accountInterestRate: BigDecimal? = null - - /** - * See [TermDeposit.startDate]. - */ - var startDate: OffsetDateTime? = null - - /** - * See [TermDeposit.termUnit]. - */ - var termUnit: TimeUnit? = null - - /** - * See [TermDeposit.termNumber]. - */ - var termNumber: BigDecimal? = null - - /** - * See [TermDeposit.maturityDate]. - */ - var maturityDate: OffsetDateTime? = null - - /** - * See [TermDeposit.maturityAmount]. - */ - var maturityAmount: BigDecimal? = null - - /** - * See [TermDeposit.autoRenewalIndicator]. - */ - var autoRenewalIndicator: Boolean? = null - - /** - * See [TermDeposit.interestPaymentFrequencyUnit]. - */ - var interestPaymentFrequencyUnit: TimeUnit? = null - - /** - * See [TermDeposit.interestPaymentFrequencyNumber]. - */ - var interestPaymentFrequencyNumber: BigDecimal? = null - - /** - * See [TermDeposit.interestSettlementAccount]. - */ - var interestSettlementAccount: String? = null - - /** - * See [TermDeposit.valueDateBalance]. - */ - var valueDateBalance: BigDecimal? = null - - /** - * See [TermDeposit.accountHolderNames]. - */ - var accountHolderNames: String? = null - - /** - * See [TermDeposit.outstandingPrincipalAmount]. - */ - var outstandingPrincipalAmount: BigDecimal? = null - - /** - * See [TermDeposit.creditAccount]. - */ - var creditAccount: Boolean? = null - - /** - * See [TermDeposit.debitAccount]. - */ - var debitAccount: Boolean? = null - - /** - * See [TermDeposit.minimumRequiredBalance]. - */ - var minimumRequiredBalance: BigDecimal? = null - - /** - * See [TermDeposit.id]. - */ - var id: String? = null - - /** - * See [TermDeposit.name]. - */ - var name: String? = null - - /** - * See [TermDeposit.externalTransferAllowed]. - */ - var externalTransferAllowed: Boolean? = null - - /** - * See [TermDeposit.crossCurrencyAllowed]. - */ - var crossCurrencyAllowed: Boolean? = null - - /** - * See [TermDeposit.productKindName]. - */ - var productKindName: String? = null - - /** - * See [TermDeposit.productTypeName]. - */ - var productTypeName: String? = null - - /** - * See [TermDeposit.bankAlias]. - */ - var bankAlias: String? = null - - /** - * See [TermDeposit.sourceId]. - */ - var sourceId: String? = null - - /** - * See [TermDeposit.accountOpeningDate]. - */ - var accountOpeningDate: OffsetDateTime? = null - - /** - * See [TermDeposit.lastUpdateDate]. - */ - var lastUpdateDate: OffsetDateTime? = null - - /** - * See [TermDeposit.userPreferences]. - */ - var userPreferences: UserPreferences? = null - - /** - * See [TermDeposit.state]. - */ - var state: ProductState? = null - - /** - * See [TermDeposit.subArrangements]. - */ - var subArrangements: List? = null - - /** - * See [TermDeposit.parentId]. - */ - var parentId: String? = null - - /** - * See [TermDeposit.financialInstitutionId]. - */ - var financialInstitutionId: Long? = null - - /** - * See [TermDeposit.lastSyncDate]. - */ - var lastSyncDate: OffsetDateTime? = null - - /** - * See [TermDeposit.additions]. - */ - var additions: Map? = null - - /** - * See [TermDeposit.displayName]. - */ - var displayName: String? = null - - /** - * See [TermDeposit.cardDetails]. - */ - var cardDetails: CardDetails? = null - - /** - * See [TermDeposit.interestDetails]. - */ - var interestDetails: InterestDetails? = null - - /** - * See [TermDeposit.reservedAmount]. - */ - var reservedAmount: BigDecimal? = null - - /** - * See [TermDeposit.remainingPeriodicTransfers]. - */ - var remainingPeriodicTransfers: BigDecimal? = null - - /** - * See [TermDeposit.nextClosingDate]. - */ - var nextClosingDate: LocalDate? = null - - /** - * See [TermDeposit.overdueSince]. - */ - var overdueSince: LocalDate? = null - - /** - * See [TermDeposit.externalAccountStatus]. - */ - var externalAccountStatus: String? = null - - /** - * See [TermDeposit.bankBranchCode]. - */ - var bankBranchCode: String? = null - - /** - * See [TermDeposit.bankBranchCode2]. - */ - var bankBranchCode2: String? = null - - /** - * See [TermDeposit.availableBalance]. - */ - var availableBalance: String? = null - - /** - * See [TermDeposit.creditLimit]. - */ - var creditLimit: String? = null - - /** - * See [TermDeposit.minimumPayment]. - */ - var minimumPayment: BigDecimal? = null - - /** - * See [TermDeposit.minimumPaymentDueDate]. - */ - var minimumPaymentDueDate: OffsetDateTime? = null - - /** - * See [TermDeposit.bookedBalance]. - */ - fun setBookedBalance(bookedBalance: String?) = apply { this.bookedBalance = bookedBalance } - - /** - * See [TermDeposit.principalAmount]. - */ - fun setPrincipalAmount(principalAmount: BigDecimal?) = - apply { this.principalAmount = principalAmount } - - /** - * See [TermDeposit.accruedInterest]. - */ - fun setAccruedInterest(accruedInterest: BigDecimal?) = - apply { this.accruedInterest = accruedInterest } - - /** - * See [TermDeposit.IBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setIBAN(IBAN: String?) = apply { this.IBAN = IBAN } - - /** - * See [TermDeposit.BBAN]. - */ - @SuppressWarnings("FunctionParameterNaming") - fun setBBAN(BBAN: String?) = apply { this.BBAN = BBAN } - - /** - * See [TermDeposit.unMaskableAttributes]. - */ - fun setUnMaskableAttributes(unMaskableAttributes: Set?) = - apply { this.unMaskableAttributes = unMaskableAttributes } - - /** - * See [TermDeposit.currency]. - */ - fun setCurrency(currency: String?) = apply { this.currency = currency } - - /** - * See [TermDeposit.urgentTransferAllowed]. - */ - fun setUrgentTransferAllowed(urgentTransferAllowed: Boolean?) = - apply { this.urgentTransferAllowed = urgentTransferAllowed } - - /** - * See [TermDeposit.productNumber]. - */ - fun setProductNumber(productNumber: String?) = apply { this.productNumber = productNumber } - - /** - * See [TermDeposit.accountInterestRate]. - */ - fun setAccountInterestRate(accountInterestRate: BigDecimal?) = - apply { this.accountInterestRate = accountInterestRate } - - /** - * See [TermDeposit.startDate]. - */ - fun setStartDate(startDate: OffsetDateTime?) = apply { this.startDate = startDate } - - /** - * See [TermDeposit.termUnit]. - */ - fun setTermUnit(termUnit: TimeUnit?) = apply { this.termUnit = termUnit } - - /** - * See [TermDeposit.termNumber]. - */ - fun setTermNumber(termNumber: BigDecimal?) = apply { this.termNumber = termNumber } - - /** - * See [TermDeposit.maturityDate]. - */ - fun setMaturityDate(maturityDate: OffsetDateTime?) = - apply { this.maturityDate = maturityDate } - - /** - * See [TermDeposit.maturityAmount]. - */ - fun setMaturityAmount(maturityAmount: BigDecimal?) = - apply { this.maturityAmount = maturityAmount } - - /** - * See [TermDeposit.autoRenewalIndicator]. - */ - fun setAutoRenewalIndicator(autoRenewalIndicator: Boolean?) = - apply { this.autoRenewalIndicator = autoRenewalIndicator } - - /** - * See [TermDeposit.interestPaymentFrequencyUnit]. - */ - fun setInterestPaymentFrequencyUnit(interestPaymentFrequencyUnit: TimeUnit?) = - apply { this.interestPaymentFrequencyUnit = interestPaymentFrequencyUnit } - - /** - * See [TermDeposit.interestPaymentFrequencyNumber]. - */ - fun setInterestPaymentFrequencyNumber(interestPaymentFrequencyNumber: BigDecimal?) = - apply { this.interestPaymentFrequencyNumber = interestPaymentFrequencyNumber } - - /** - * See [TermDeposit.interestSettlementAccount]. - */ - fun setInterestSettlementAccount(interestSettlementAccount: String?) = - apply { this.interestSettlementAccount = interestSettlementAccount } - - /** - * See [TermDeposit.valueDateBalance]. - */ - fun setValueDateBalance(valueDateBalance: BigDecimal?) = - apply { this.valueDateBalance = valueDateBalance } - - /** - * See [TermDeposit.accountHolderNames]. - */ - fun setAccountHolderNames(accountHolderNames: String?) = - apply { this.accountHolderNames = accountHolderNames } - - /** - * See [TermDeposit.outstandingPrincipalAmount]. - */ - fun setOutstandingPrincipalAmount(outstandingPrincipalAmount: BigDecimal?) = - apply { this.outstandingPrincipalAmount = outstandingPrincipalAmount } - - /** - * See [TermDeposit.creditAccount]. - */ - fun setCreditAccount(creditAccount: Boolean?) = apply { this.creditAccount = creditAccount } - - /** - * See [TermDeposit.debitAccount]. - */ - fun setDebitAccount(debitAccount: Boolean?) = apply { this.debitAccount = debitAccount } - - /** - * See [TermDeposit.minimumRequiredBalance]. - */ - fun setMinimumRequiredBalance(minimumRequiredBalance: BigDecimal?) = - apply { this.minimumRequiredBalance = minimumRequiredBalance } - - /** - * See [TermDeposit.id]. - */ - fun setId(id: String?) = apply { this.id = id } - - /** - * See [TermDeposit.name]. - */ - fun setName(name: String?) = apply { this.name = name } - - /** - * See [TermDeposit.externalTransferAllowed]. - */ - fun setExternalTransferAllowed(externalTransferAllowed: Boolean?) = - apply { this.externalTransferAllowed = externalTransferAllowed } - - /** - * See [TermDeposit.crossCurrencyAllowed]. - */ - fun setCrossCurrencyAllowed(crossCurrencyAllowed: Boolean?) = - apply { this.crossCurrencyAllowed = crossCurrencyAllowed } - - /** - * See [TermDeposit.productKindName]. - */ - fun setProductKindName(productKindName: String?) = - apply { this.productKindName = productKindName } - - /** - * See [TermDeposit.productTypeName]. - */ - fun setProductTypeName(productTypeName: String?) = - apply { this.productTypeName = productTypeName } - - /** - * See [TermDeposit.bankAlias]. - */ - fun setBankAlias(bankAlias: String?) = apply { this.bankAlias = bankAlias } - - /** - * See [TermDeposit.sourceId]. - */ - fun setSourceId(sourceId: String?) = apply { this.sourceId = sourceId } - - /** - * See [TermDeposit.accountOpeningDate]. - */ - fun setAccountOpeningDate(accountOpeningDate: OffsetDateTime?) = - apply { this.accountOpeningDate = accountOpeningDate } - - /** - * See [TermDeposit.lastUpdateDate]. - */ - fun setLastUpdateDate(lastUpdateDate: OffsetDateTime?) = - apply { this.lastUpdateDate = lastUpdateDate } - - /** - * See [TermDeposit.userPreferences]. - */ - fun setUserPreferences(userPreferences: UserPreferences?) = - apply { this.userPreferences = userPreferences } - - /** - * See [TermDeposit.state]. - */ - fun setState(state: ProductState?) = apply { this.state = state } - - /** - * See [TermDeposit.subArrangements]. - */ - fun setSubArrangements(subArrangements: List?) = apply { - this.subArrangements = subArrangements - } - - /** - * See [TermDeposit.parentId]. - */ - fun setParentId(parentId: String?) = apply { this.parentId = parentId } - - /** - * See [TermDeposit.financialInstitutionId]. - */ - fun setFinancialInstitutionId(financialInstitutionId: Long?) = - apply { this.financialInstitutionId = financialInstitutionId } - - /** - * See [TermDeposit.lastSyncDate]. - */ - fun setLastSyncDate(lastSyncDate: OffsetDateTime?) = - apply { this.lastSyncDate = lastSyncDate } - - /** - * See [TermDeposit.additions]. - */ - fun setAdditions(additions: Map?) = - apply { this.additions = additions } - - /** - * See [TermDeposit.displayName]. - */ - fun setDisplayName(displayName: String?) = - apply { this.displayName = displayName } - - /** - * See [TermDeposit.cardDetails]. - */ - fun setCardDetails(cardDetails: CardDetails?) = - apply { this.cardDetails = cardDetails } - - /** - * See [TermDeposit.reservedAmount]. - */ - fun setReservedAmount(reservedAmount: BigDecimal?) = - apply { this.reservedAmount = reservedAmount } - - /** - * See [TermDeposit.remainingPeriodicTransfers]. - */ - fun setRemainingPeriodicTransfers(remainingPeriodicTransfers: BigDecimal?) = - apply { this.remainingPeriodicTransfers = remainingPeriodicTransfers } - - /** - * See [TermDeposit.nextClosingDate]. - */ - fun setNextClosingDate(nextClosingDate: LocalDate?) = - apply { this.nextClosingDate = nextClosingDate } - - /** - * See [TermDeposit.overdueSince]. - */ - fun setOverdueSince(overdueSince: LocalDate?) = - apply { this.overdueSince = overdueSince } - - /** - * See [TermDeposit.externalAccountStatus]. - */ - fun setExternalAccountStatus(externalAccountStatus: String?) = - apply { this.externalAccountStatus = externalAccountStatus } - - /** - * See [TermDeposit.interestDetails]. - */ - fun setInterestDetails(interestDetails: InterestDetails?) = - apply { this.interestDetails = interestDetails } - - /** - * See [TermDeposit.bankBranchCode]. - */ - fun setBankBranchCode(bankBranchCode: String?) = apply { - this.bankBranchCode = bankBranchCode - } - - /** - * See [TermDeposit.bankBranchCode2]. - */ - fun setBankBranchCode2(bankBranchCode2: String?) = apply { - this.bankBranchCode2 = bankBranchCode2 - } - - /** - * See [TermDeposit.availableBalance]. - */ - fun setAvailableBalance(availableBalance: String?) = - apply { this.availableBalance = availableBalance } - - /** - * See [TermDeposit.creditLimit]. - */ - fun setCreditLimit(creditLimit: String?) = apply { this.creditLimit = creditLimit } - - /** - * See [TermDeposit.minimumPayment]. - */ - fun setMinimumPayment(minimumPayment: BigDecimal?) = - apply { this.minimumPayment = minimumPayment } - - /** - * See [TermDeposit.minimumPaymentDueDate]. - */ - fun setMinimumPaymentDueDate(minimumPaymentDueDate: OffsetDateTime?) = - apply { this.minimumPaymentDueDate = minimumPaymentDueDate } - - /** - * Builds an instance of [TermDeposit]. - */ - fun build() = TermDeposit( - bookedBalance = bookedBalance, - principalAmount = principalAmount, - accruedInterest = accruedInterest, - IBAN = IBAN, - BBAN = BBAN, - unMaskableAttributes = unMaskableAttributes, - currency = currency, - urgentTransferAllowed = urgentTransferAllowed, - productNumber = productNumber, - accountInterestRate = accountInterestRate, - startDate = startDate, - termUnit = termUnit, - termNumber = termNumber, - maturityDate = maturityDate, - maturityAmount = maturityAmount, - autoRenewalIndicator = autoRenewalIndicator, - interestPaymentFrequencyUnit = interestPaymentFrequencyUnit, - interestPaymentFrequencyNumber = interestPaymentFrequencyNumber, - interestSettlementAccount = interestSettlementAccount, - valueDateBalance = valueDateBalance, - accountHolderNames = accountHolderNames, - outstandingPrincipalAmount = outstandingPrincipalAmount, - creditAccount = creditAccount, - debitAccount = debitAccount, - minimumRequiredBalance = minimumRequiredBalance, - id = id, - name = name, - externalTransferAllowed = externalTransferAllowed, - crossCurrencyAllowed = crossCurrencyAllowed, - productKindName = productKindName, - productTypeName = productTypeName, - bankAlias = bankAlias, - sourceId = sourceId, - accountOpeningDate = accountOpeningDate, - lastUpdateDate = lastUpdateDate, - userPreferences = userPreferences, - state = state, - subArrangements = subArrangements, - parentId = parentId, - financialInstitutionId = financialInstitutionId, - lastSyncDate = lastSyncDate, - additions = additions, - displayName = displayName, - cardDetails = cardDetails, - interestDetails = interestDetails, - reservedAmount = reservedAmount, - remainingPeriodicTransfers = remainingPeriodicTransfers, - nextClosingDate = nextClosingDate, - overdueSince = overdueSince, - externalAccountStatus = externalAccountStatus, - bankBranchCode = bankBranchCode, - bankBranchCode2 = bankBranchCode2, - availableBalance = availableBalance, - creditLimit = creditLimit, - minimumPayment = minimumPayment, - minimumPaymentDueDate = minimumPaymentDueDate, - ) - } -} - -/** - * Builds an instance of [TermDeposit] with the [initializer] parameters. - */ -@Suppress("FunctionName") // DSL initializer -fun TermDeposit(initializer: TermDeposit.Builder.() -> Unit): TermDeposit { - return TermDeposit.Builder().apply(initializer).build() -} diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/term_deposits/TermDeposits.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/term_deposits/TermDeposits.kt deleted file mode 100644 index 0d9ac4a7..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/account_summary/term_deposits/TermDeposits.kt +++ /dev/null @@ -1,96 +0,0 @@ -package com.backbase.accounts_journey.domain.model.account_summary.term_deposits - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.common.AggregatedBalance -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param products The list of term deposit. - * @param name The label/name for term deposits. - * @param aggregatedBalance The aggregated balance of this group of products. - * @param additions Extra parameters - */ -@Poko -@Parcelize -class TermDeposits private constructor( - val products: List, - val name: String?, - val aggregatedBalance: AggregatedBalance?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [TermDeposits.products] - */ - var products: List? = null - - /** - * See [TermDeposits.products] - */ - var name: String? = null - - /** - * See [TermDeposits.aggregatedBalance] - */ - var aggregatedBalance: AggregatedBalance? = null - - /** - * See [TermDeposits.additions] - */ - var additions: Map? = null - - /** - * See [TermDeposits.products] - */ - fun setProducts(products: List) = apply { - this.products = products - } - - /** - * See [TermDeposits.products] - */ - fun setName(name: String?) = apply { - this.name = name - } - - /** - * See [TermDeposits.aggregatedBalance] - */ - fun setAggregatedBalance(aggregatedBalance: AggregatedBalance?) = apply { - this.aggregatedBalance = aggregatedBalance - } - - /** - * See [TermDeposits.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Build an instance of [TermDeposits] - */ - fun build() = TermDeposits( - requireNotNull(products), - name, - aggregatedBalance, - additions - ) - } -} - -/** - * DSL to create [TermDeposits] - */ -fun TermDeposits(block: TermDeposits.Builder.() -> Unit) = TermDeposits.Builder().apply(block).build() - -internal fun TermDeposits?.allProducts(): List = this?.products ?: emptyList() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/AggregatedBalance.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/AggregatedBalance.kt deleted file mode 100644 index 0f4a2ff2..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/AggregatedBalance.kt +++ /dev/null @@ -1,98 +0,0 @@ -package com.backbase.accounts_journey.domain.model.common - -import android.os.Parcelable -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * Defines a balance for groups of products. This field is not implemented OOTB, and it should be implemented by project/customer. - * - * @property currency A code/text that represents a currency, defaults to "null" - * @property value The absolute value of the balance, defaults to "null". - * @property productKindAggregateBalanceItem The aggregated balance of each product kind, defaults to "null". - * @property additions Extra information, defaults to "null". - */ -@Poko -@Parcelize -class AggregatedBalance internal constructor( - val currency: String?, - val value: String?, - val productKindAggregateBalanceItem: List?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [AggregatedBalance.currency] - */ - var currency: String? = null - - /** - * See [AggregatedBalance.value] - */ - var value: String? = null - - /** - * See [AggregatedBalance.productKindAggregateBalanceItem] - */ - var productKindAggregateBalanceItem: List? = null - - /** - * See [AggregatedBalance.additions] - */ - var additions: Map? = null - - /** - * See [AggregatedBalance.currency] - */ - fun setCurrency(currency: String?) = apply { - this.currency = currency - } - - /** - * See [AggregatedBalance.value] - */ - fun setValue(value: String?) = apply { - this.value = value - } - - /** - * See [AggregatedBalance.productKindAggregateBalanceItem] - */ - fun setProductKindAggregateBalanceItem( - productKindAggregateBalanceItem: List? - ) = - apply { - this.productKindAggregateBalanceItem = productKindAggregateBalanceItem - } - - /** - * See [AggregatedBalance.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Builds an instance of [AggregatedBalance] - */ - fun build() = AggregatedBalance( - currency, - value, - productKindAggregateBalanceItem, - additions - ) - } -} - -/** - * DSL to create [AggregatedBalance] - */ -fun AggregatedBalance(block: AggregatedBalance.Builder.() -> Unit) = AggregatedBalance.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/BaseProduct.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/BaseProduct.kt deleted file mode 100644 index 0e07a694..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/BaseProduct.kt +++ /dev/null @@ -1,251 +0,0 @@ -package com.backbase.accounts_journey.domain.model.common - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal -import java.time.LocalDate -import java.time.OffsetDateTime -import java.util.* - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * This class contains fields that are common to all products, but be aware no product directly extends this class. - * - * @param id Reference to the product of which the arrangement is an instantiation. - * @param name The name of the product. - * @param externalTransferAllowed Defines if transfer to another party is allowed. - * @param crossCurrencyAllowed Defines if cross currency transfer is allowed - * @param productKindName The label/name that is used for the respective product kind - * @param productTypeName The label/name that is used to label a specific product type - * @param bankAlias The name that can be assigned by the bank to label the arrangement. - * @param sourceId Indicate if the account is regular or external - * @param visible indicator whether to show or hide the arrangement on the widget - * @param accountOpeningDate The date this account was opened. - * @param lastUpdateDate Last date of parameter update for the arrangement. - * @param userPreferences The preferences configured by the user. - * @param state the state of the product. See [ProductState]. - * @param parentId Reference to the parent of the arrangement. - * @param subArrangements A list of arrangements whose parent is this product. - * @param financialInstitutionId Financial institution ID - * @param lastSyncDate Last synchronization datetime - * @param additions Additional name-value pairs. - * @param cardDetails - * @param interestDetails - * @param reservedAmount The reservation of a portion of a credit or debit balance for the cost of services not yet rendered. - * @param remainingPeriodicTransfers The limitation in periodic saving transfers or withdrawals. In the case of the US, Regulation D enables for a maximum of 6 monthly savings transfers or withdrawals. - * @param overdueSince The date in which the arrangement has been overdue since. - * @param externalAccountStatus Synchronization statuses an account can have on the provider side after it has been aggregated. - * @param bankBranchCode2 (This is to accomodate additional country specific fields fedwire Routing Nmber) - * @param nextClosingDate The last day of the forthcoming billing cycle. - */ -@Suppress("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class BaseProduct internal constructor( - val id: String?, - val name: String?, - val externalTransferAllowed: Boolean?, - val crossCurrencyAllowed: Boolean?, - val productKindName: String?, - val productTypeName: String?, - val bankAlias: String?, - val sourceId: String?, - val visible: Boolean?, - val accountOpeningDate: OffsetDateTime?, - val lastUpdateDate: OffsetDateTime?, - val userPreferences: UserPreferences?, - val state: ProductState?, - val parentId: String?, - val subArrangements: List?, - val financialInstitutionId: Long?, - val lastSyncDate: OffsetDateTime?, - val additions: Map?, - val cardDetails: CardDetails?, - val interestDetails: InterestDetails?, - val reservedAmount: BigDecimal?, - val remainingPeriodicTransfers: BigDecimal?, - val nextClosingDate: LocalDate?, - val overdueSince: LocalDate?, - val externalAccountStatus: String?, - val bankBranchCode2: String?, -) : Parcelable { - - /** - * A builder for [BaseProduct]. - */ - class Builder { - - /** - * See [BaseProduct.id]. - */ - var id: String? = null - - /** - * See [BaseProduct.name]. - */ - var name: String? = null - - /** - * See [BaseProduct.externalTransferAllowed]. - */ - var externalTransferAllowed: Boolean? = null - - /** - * See [BaseProduct.crossCurrencyAllowed]. - */ - var crossCurrencyAllowed: Boolean? = null - - /** - * See [BaseProduct.productKindName]. - */ - var productKindName: String? = null - - /** - * See [BaseProduct.productTypeName]. - */ - var productTypeName: String? = null - - /** - * See [BaseProduct.bankAlias]. - */ - var bankAlias: String? = null - - /** - * See [BaseProduct.sourceId]. - */ - var sourceId: String? = null - - /** - * See [BaseProduct.visible]. - */ - var visible: Boolean? = null - - /** - * See [BaseProduct.accountOpeningDate]. - */ - var accountOpeningDate: OffsetDateTime? = null - - /** - * See [BaseProduct.lastUpdateDate]. - */ - var lastUpdateDate: OffsetDateTime? = null - - /** - * See [BaseProduct.userPreferences]. - */ - var userPreferences: UserPreferences? = null - - /** - * See [BaseProduct.state]. - */ - var state: ProductState? = null - - /** - * See [BaseProduct.parentId]. - */ - var parentId: String? = null - - /** - * See [BaseProduct.subArrangements]. - */ - var subArrangements: List? = null - - /** - * See [BaseProduct.financialInstitutionId]. - */ - var financialInstitutionId: Long? = null - - /** - * See [BaseProduct.lastSyncDate]. - */ - var lastSyncDate: OffsetDateTime? = null - - /** - * See [BaseProduct.additions]. - */ - var additions: Map? = null - - /** - * See [BaseProduct.cardDetails]. - */ - var cardDetails: CardDetails? = null - - /** - * See [BaseProduct.interestDetails]. - */ - var interestDetails: InterestDetails? = null - - /** - * See [BaseProduct.reservedAmount]. - */ - var reservedAmount: BigDecimal? = null - - /** - * See [BaseProduct.remainingPeriodicTransfers]. - */ - var remainingPeriodicTransfers: BigDecimal? = null - - /** - * See [BaseProduct.nextClosingDate]. - */ - var nextClosingDate: LocalDate? = null - - /** - * See [BaseProduct.overdueSince]. - */ - var overdueSince: LocalDate? = null - - /** - * See [BaseProduct.externalAccountStatus]. - */ - var externalAccountStatus: String? = null - - /** - * See [BaseProduct.bankBranchCode2]. - */ - var bankBranchCode2: String? = null - - /** - * Builds an instance of [BaseProduct]. - */ - fun build() = BaseProduct( - id = id, - name = name, - externalTransferAllowed = externalTransferAllowed, - crossCurrencyAllowed = crossCurrencyAllowed, - productKindName = productKindName, - productTypeName = productTypeName, - bankAlias = bankAlias, - sourceId = sourceId, - visible = visible, - accountOpeningDate = accountOpeningDate, - lastUpdateDate = lastUpdateDate, - userPreferences = userPreferences, - state = state, - parentId = parentId, - subArrangements = subArrangements, - financialInstitutionId = financialInstitutionId, - lastSyncDate = lastSyncDate, - additions = additions, - cardDetails = cardDetails, - interestDetails = interestDetails, - reservedAmount = reservedAmount, - remainingPeriodicTransfers = remainingPeriodicTransfers, - nextClosingDate = nextClosingDate, - overdueSince = overdueSince, - externalAccountStatus = externalAccountStatus, - bankBranchCode2 = bankBranchCode2, - ) - } -} - -/** - * Builds an instance of [BaseProduct] with the [initializer] parameters. - */ -@Suppress("FunctionName") // DSL initializer -fun BaseProduct(initializer: BaseProduct.Builder.() -> Unit): BaseProduct { - return BaseProduct.Builder().apply(initializer).build() -} diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/CardDetails.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/CardDetails.kt deleted file mode 100644 index 4c9fdb4f..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/CardDetails.kt +++ /dev/null @@ -1,125 +0,0 @@ -package com.backbase.accounts_journey.domain.model.common - -import android.os.Parcelable -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal -import java.time.LocalDate - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param cardProvider This field specifies the Card Provider associated with the Account. Example: Maestro, Visa, Master Card, American Express or Discover. - * @param secured A card can either be Secured or Unsecured. true: amount deposited in the CC determines the Limit. false: credit limit is based off various factors including the CC holder’s Credit Score, Credit History and is determined by the lending bank. - * @param availableCashCredit The amount of money currently available for a bank cash advance.This is calculated given the portion of the CashCreditLimit which has been used for Cash Advance Transactions. - * @param cashCreditLimit The portion of the credit limit available for bank cash advance transactions. - * @param lastPaymentDate The Date the last payment was made on the Credit-based arrangement. - * @param lastPaymentAmount The amount of the last payment that was made on the Credit-based arrangement. - * @param latePaymentFee The charge triggered by infractions such as late credit card payments. It can be expressed as fixed amount or as percent.Example: 12.32: as fixed amount, 3.14%: as percent - * @param previousStatementDate The date of the previous billing cycle for the arrangement. - * @param previousStatementBalance The amount owed on the credit card as of the previous billing cycle. - * @param statementBalance The amount owed on the credit card as of the latest billing cycle. - * @param additions Extra parameters - */ -@Suppress("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class CardDetails internal constructor( - val cardProvider: String?, - val secured: Boolean?, - val availableCashCredit: BigDecimal?, - val cashCreditLimit: BigDecimal?, - val lastPaymentDate: LocalDate?, - val lastPaymentAmount: BigDecimal?, - val latePaymentFee: String?, - val previousStatementDate: LocalDate?, - val previousStatementBalance: BigDecimal?, - val statementBalance: BigDecimal?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - - /** - * See [CardDetails.cardProvider] - */ - var cardProvider: String? = null - - /** - * See [CardDetails.secured] - */ - var secured: Boolean? = null - - /** - * See [CardDetails.availableCashCredit] - */ - var availableCashCredit: BigDecimal? = null - - /** - * See [CardDetails.cashCreditLimit] - */ - var cashCreditLimit: BigDecimal? = null - - /** - * See [CardDetails.lastPaymentDate] - */ - var lastPaymentDate: LocalDate? = null - - /** - * See [CardDetails.lastPaymentAmount] - */ - var lastPaymentAmount: BigDecimal? = null - - /** - * See [CardDetails.latePaymentFee] - */ - var latePaymentFee: String? = null - - /** - * See [CardDetails.previousStatementDate] - */ - var previousStatementDate: LocalDate? = null - - /** - * See [CardDetails.previousStatementBalance] - */ - var previousStatementBalance: BigDecimal? = null - - /** - * See [CardDetails.statementBalance] - */ - var statementBalance: BigDecimal? = null - - /** - * See [CardDetails.additions] - */ - var additions: Map? = null - - /** - * Build an instance of [CardDetails] - */ - fun build() = CardDetails( - cardProvider, - secured, - availableCashCredit, - cashCreditLimit, - lastPaymentDate, - lastPaymentAmount, - latePaymentFee, - previousStatementDate, - previousStatementBalance, - statementBalance, - additions - ) - } -} - -/** - * DSL to create [CardDetails] - */ -fun CardDetails(block: CardDetails.Builder.() -> Unit) = CardDetails.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/DebitCardItem.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/DebitCardItem.kt deleted file mode 100644 index b9979a33..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/DebitCardItem.kt +++ /dev/null @@ -1,139 +0,0 @@ -package com.backbase.accounts_journey.domain.model.common - -import android.os.Parcelable -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param number First 6 and/or last 4 digits of a Payment card. All other digits will/to be masked. Be aware that using card number differently is potential PCI risk. - * @param expiryDate Expiration date of a debit card, after which is no longer valid. - * @param cardId External ID of the card. - * @param cardHolderName First Name and Last Name of card holder. - * @param cardType Card type to change card image based on it, ex. Maestro Gold - * @param cardStatus Status of the card ex. Active, Expired etc. - * @param additions Extra parameters - */ -@Suppress("LongParameterList", "MaxLineLength") -@Poko -@Parcelize -class DebitCardItem internal constructor( - val number: String?, - val expiryDate: String?, - val cardId: String?, - val cardHolderName: String?, - val cardType: String?, - val cardStatus: String?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.number] - */ - var number: String? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.expiryDate] - */ - var expiryDate: String? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.cardId] - */ - var cardId: String? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.cardHolderName] - */ - var cardHolderName: String? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.cardType] - */ - var cardType: String? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.cardStatus] - */ - var cardStatus: String? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.additions] - */ - var additions: Map? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.number] - */ - fun setNumber(number: String?) = apply { - this.number = number - } - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.expiryDate] - */ - fun setExpiryDate(expiryDate: String?) = apply { - this.expiryDate = expiryDate - } - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.cardId] - */ - fun setCardId(cardId: String?) = apply { - this.cardId = cardId - } - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.cardHolderName] - */ - fun setCardHolderName(cardHolderName: String?) = apply { - this.cardHolderName = cardHolderName - } - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.cardType] - */ - fun setCardType(cardType: String?) = apply { - this.cardType = cardType - } - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem] - */ - fun setCardStatus(cardStatus: String?) = apply { - this.cardStatus = cardStatus - } - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.DebitCardItem.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Builds an instance of [DebitCardItem] - */ - fun build() = DebitCardItem( - number, - expiryDate, - cardId, - cardHolderName, - cardType, - cardStatus, - additions - ) - } -} - -/** - * DSL to create [DebitCardItem] - */ -fun DebitCardItem(block: DebitCardItem.Builder.() -> Unit) = DebitCardItem.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/InterestDetails.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/InterestDetails.kt deleted file mode 100644 index 6ad046ab..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/InterestDetails.kt +++ /dev/null @@ -1,84 +0,0 @@ -package com.backbase.accounts_journey.domain.model.common - -import android.os.Parcelable -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param lastYearAccruedInterest Last year's interest that was earned (credit interest) or due (debit interest) - * @param dividendWithheldYTD Total amount of interest that is being withheld up to date and the bank provides 1099 document end of the year for Tax return purpose Example: - 12.32: as fixed amount - 3.14%: as percent - * @param annualPercentageYield The real rate of return earned on a savings deposit or investment taking into account the effect of compounding interest. - * @param cashAdvanceInterestRate The Interest charge that is added monthly on the outstanding cash advance due on a credit card. - * @param penaltyInterestRate The Interest charge triggered by infractions such as late credit card payments. - * @param additions Extra parameters - */ -@SuppressWarnings("MaxLineLength") -@Poko -@Parcelize -class InterestDetails internal constructor( - val lastYearAccruedInterest: BigDecimal?, - val dividendWithheldYTD: String?, - val annualPercentageYield: BigDecimal?, - val cashAdvanceInterestRate: BigDecimal?, - val penaltyInterestRate: BigDecimal?, - val additions: Map?, -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - - /** - * See [InterestDetails.lastYearAccruedInterest] - */ - var lastYearAccruedInterest: BigDecimal? = null - - /** - * See [InterestDetails.dividendWithheldYTD] - */ - var dividendWithheldYTD: String? = null - - /** - * See [InterestDetails.annualPercentageYield] - */ - var annualPercentageYield: BigDecimal? = null - - /** - * See [InterestDetails.cashAdvanceInterestRate] - */ - var cashAdvanceInterestRate: BigDecimal? = null - - /** - * See [InterestDetails.penaltyInterestRate] - */ - var penaltyInterestRate: BigDecimal? = null - - /** - * See [InterestDetails.additions] - */ - var additions: Map? = null - - /** - * Build an instance of [InterestDetails] - */ - fun build() = InterestDetails( - lastYearAccruedInterest = lastYearAccruedInterest, - dividendWithheldYTD = dividendWithheldYTD, - annualPercentageYield = annualPercentageYield, - cashAdvanceInterestRate = cashAdvanceInterestRate, - penaltyInterestRate = penaltyInterestRate, - additions = additions, - ) - } -} - -/** - * DSL to create [InterestDetails] - */ -fun InterestDetails(block: InterestDetails.Builder.() -> Unit) = InterestDetails.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/ProductKindAggregateBalanceItem.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/ProductKindAggregateBalanceItem.kt deleted file mode 100644 index 5524c0b5..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/ProductKindAggregateBalanceItem.kt +++ /dev/null @@ -1,59 +0,0 @@ -package com.backbase.accounts_journey.domain.model.common - -import android.os.Parcelable -import com.backbase.accounts_journey.domain.model.common.ProductKindAggregateBalanceItem.Builder -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize -import java.math.BigDecimal - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * [ProductKindAggregateBalanceItem] The aggregated balance of each product kind. - * - * @property amount The amount in the specified currency, defaults to "null" - * @property numberOfAccounts Number of accounts that are aggregated for this currency, defaults to "null" - * @property productKindName Name of the product kind, defaults to "null" - */ -@Poko -@Parcelize -class ProductKindAggregateBalanceItem private constructor( - val amount: BigDecimal?, - val numberOfAccounts: Long?, - val productKindName: String?, -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - - /** - * @see [ProductKindAggregateBalanceItem.amount] - */ - var amount: BigDecimal? = null - - /** - * @see [ProductKindAggregateBalanceItem.numberOfAccounts] - */ - var numberOfAccounts: Long? = null - - /** - * @see [ProductKindAggregateBalanceItem.productKindName] - */ - var productKindName: String? = null - - /** - * Builds an instance of [ProductKindAggregateBalanceItem] - */ - fun build() = ProductKindAggregateBalanceItem( - amount = amount, - numberOfAccounts = numberOfAccounts, - productKindName = productKindName - ) - } -} - -@Suppress("FunctionName") // DSL initializer -fun ProductKindAggregateBalanceItem(initializer: Builder.() -> Unit) = Builder().apply(initializer).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/ProductState.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/ProductState.kt deleted file mode 100644 index 66b3e5ef..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/ProductState.kt +++ /dev/null @@ -1,78 +0,0 @@ -package com.backbase.accounts_journey.domain.model.common - -import android.os.Parcelable -import dev.drewhamilton.poko.Poko -import kotlinx.parcelize.Parcelize - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * @param externalStateId An external unique identifier for the arrangement state object. - * @param state Name that describes the specific arrangement state. - * @param additions Any extra information - */ -@Poko -@Parcelize -class ProductState internal constructor( - val externalStateId: String?, - val state: String?, - val additions: Map? -) : Parcelable { - - /** - * A builder for this configuration class - * - * Should be directly used by Java consumers. Kotlin consumers should use DSL function - */ - class Builder { - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.ProductState.externalStateId] - */ - var externalStateId: String? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.ProductState.state] - */ - var state: String? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.ProductState.additions] - */ - var additions: Map? = null - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.ProductState.externalStateId] - */ - fun setExternalStateId(externalStateId: String?) = apply { - this.externalStateId = externalStateId - } - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.ProductState.state] - */ - fun setState(state: String?) = apply { - this.state = state - } - - /** - * See [com.backbase.android.retail.journey.accounts_and_transactions.accounts.product_summary_dtos.common.ProductState.additions] - */ - fun setAdditions(additions: Map?) = apply { - this.additions = additions - } - - /** - * Builds an instance of [ProductState] - */ - fun build() = ProductState( - externalStateId, - state, - additions - ) - } -} - -/** - * DSL to create [ProductState] - */ -fun ProductState(block: ProductState.Builder.() -> Unit) = ProductState.Builder().apply(block).build() diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/TimeUnit.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/TimeUnit.kt deleted file mode 100644 index 80bead33..00000000 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/domain/model/common/TimeUnit.kt +++ /dev/null @@ -1,28 +0,0 @@ -package com.backbase.accounts_journey.domain.model.common - -/** - * Created by Backbase R&D B.V. on 19/09/2023. - * - * Supported time units. - */ -enum class TimeUnit { - /** - * Day - */ - Day, - - /** - * Week - */ - Week, - - /** - * Month - */ - Month, - - /** - * Year - */ - Year -} diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/presentation/accountdetail/mapper/AccountDetailUiMapper.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/presentation/accountdetail/mapper/AccountDetailUiMapper.kt index 7a199c03..b1b3544c 100644 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/presentation/accountdetail/mapper/AccountDetailUiMapper.kt +++ b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/presentation/accountdetail/mapper/AccountDetailUiMapper.kt @@ -3,15 +3,15 @@ package com.backbase.accounts_journey.presentation.accountdetail.mapper import com.backbase.accounts_journey.configuration.AccountsJourneyConfiguration import com.backbase.accounts_journey.configuration.icon.IconsConfiguration import com.backbase.accounts_journey.domain.model.AccountType -import com.backbase.accounts_journey.domain.model.account_detail.AccountDetail import com.backbase.accounts_journey.presentation.accountdetail.model.AccountDetailUiModel +import com.backbase.android.client.gen2.arrangementclient2.model.AccountArrangementItem import com.backbase.android.design.amount.AmountFormat import java.math.BigDecimal import java.math.RoundingMode import java.time.format.DateTimeFormatter /** - * A AccountDetail mapper from domain models to UI model. + * A AccountDetail mapper from DTO models to UI model. * * Created by Backbase R&D B.V on 16/11/2023. */ @@ -21,23 +21,23 @@ class AccountDetailUiMapper(accountsJourneyConfiguration: AccountsJourneyConfigu accountsJourneyConfiguration.iconsConfiguration } - fun mapToUi(domain: AccountDetail): AccountDetailUiModel { + fun mapToUi(dto: AccountArrangementItem): AccountDetailUiModel { return AccountDetailUiModel( - id = domain.id, - name = domain.name, - BBAN = domain.BBAN ?: domain.BIC, - availableBalance = formatCurrency(domain.currency, domain.availableBalance), - accountHolderNames = domain.accountHolderNames, - productKindName = domain.product?.productKind?.kindName, - bankBranchCode = domain.bankBranchCode, - lastUpdateDate = domain.lastUpdateDate?.format(DateTimeFormatter.ofPattern("M/d/yy h:mma")), - accountInterestRate = domain.accountInterestRate?.let { rate -> + id = dto.id, + name = dto.name, + BBAN = dto.BBAN ?: dto.BIC, + availableBalance = formatCurrency(dto.currency, dto.availableBalance), + accountHolderNames = dto.accountHolderNames, + productKindName = dto.product?.productKind?.kindName, + bankBranchCode = dto.bankBranchCode, + lastUpdateDate = dto.lastUpdateDate?.format(DateTimeFormatter.ofPattern("M/d/yy h:mma")), + accountInterestRate = dto.accountInterestRate?.let { rate -> rate.setScale(2, RoundingMode.CEILING).let { "$it%" } }, - accruedInterest = formatCurrency(domain.currency, domain.accruedInterest), - creditLimit = formatCurrency(domain.currency, domain.creditLimit), - accountOpeningDate = domain.accountOpeningDate?.format(DateTimeFormatter.ofPattern("MMMM d, yyyy")), - icon = getIcon(domain.product?.externalId) + accruedInterest = formatCurrency(dto.currency, dto.accruedInterest), + creditLimit = formatCurrency(dto.currency, dto.creditLimit), + accountOpeningDate = dto.accountOpeningDate?.format(DateTimeFormatter.ofPattern("MMMM d, yyyy")), + icon = getIcon(dto.product?.externalId) ) } diff --git a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/presentation/accountlist/mapper/AccountUiMapper.kt b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/presentation/accountlist/mapper/AccountUiMapper.kt index 7fc01bed..3e36a544 100644 --- a/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/presentation/accountlist/mapper/AccountUiMapper.kt +++ b/accounts-journey/src/main/kotlin/com/backbase/accounts_journey/presentation/accountlist/mapper/AccountUiMapper.kt @@ -2,25 +2,25 @@ package com.backbase.accounts_journey.presentation.accountlist.mapper import com.backbase.accounts_journey.configuration.AccountsJourneyConfiguration import com.backbase.accounts_journey.configuration.icon.IconsConfiguration -import com.backbase.accounts_journey.domain.model.account_summary.AccountSummary -import com.backbase.accounts_journey.domain.model.account_summary.credit_card.CreditCards -import com.backbase.accounts_journey.domain.model.account_summary.current_accounts.CurrentAccounts -import com.backbase.accounts_journey.domain.model.account_summary.custom_products.CustomProducts -import com.backbase.accounts_journey.domain.model.account_summary.debit_card.DebitCards -import com.backbase.accounts_journey.domain.model.account_summary.investment_accounts.InvestmentAccounts -import com.backbase.accounts_journey.domain.model.account_summary.loan.Loans -import com.backbase.accounts_journey.domain.model.account_summary.savings_accounts.SavingsAccounts -import com.backbase.accounts_journey.domain.model.account_summary.term_deposits.TermDeposits import com.backbase.accounts_journey.presentation.accountlist.model.AccountHeaderUiModel import com.backbase.accounts_journey.presentation.accountlist.model.AccountSummaryUiModel import com.backbase.accounts_journey.presentation.accountlist.model.AccountUiModel import com.backbase.accounts_journey.presentation.accountlist.model.AccountsUiModel +import com.backbase.android.client.gen2.arrangementclient2.model.CreditCardProductKinds +import com.backbase.android.client.gen2.arrangementclient2.model.CurrentAccountProductKinds +import com.backbase.android.client.gen2.arrangementclient2.model.CustomProductKind +import com.backbase.android.client.gen2.arrangementclient2.model.DebitCardProductKinds +import com.backbase.android.client.gen2.arrangementclient2.model.InvestmentAccountProductKinds +import com.backbase.android.client.gen2.arrangementclient2.model.LoanProductKinds +import com.backbase.android.client.gen2.arrangementclient2.model.ProductSummary +import com.backbase.android.client.gen2.arrangementclient2.model.SavingsAccountProductKinds +import com.backbase.android.client.gen2.arrangementclient2.model.TermDepositProductKinds import com.backbase.android.design.amount.AmountFormat import java.math.BigDecimal import java.util.Locale /** - * A AccountSummary mapper from domain models to UI models. + * A AccountSummary mapper from DTO models to UI models. * * Created by Backbase R&D B.V on 04/10/2023. */ @@ -30,165 +30,165 @@ class AccountUiMapper(accountsJourneyConfiguration: AccountsJourneyConfiguration accountsJourneyConfiguration.iconsConfiguration } - fun mapToUi(domain: AccountSummary): AccountSummaryUiModel { + fun mapToUi(dto: ProductSummary): AccountSummaryUiModel { return AccountSummaryUiModel( - customProducts = domain.customProducts.mapToUi(), - currentAccounts = domain.currentAccounts?.mapToUi(), - savingAccounts = domain.savingsAccounts?.mapToUi(), - termDeposits = domain.termDeposits?.mapToUi(), - loans = domain.loans?.mapToUi(), - creditCards = domain.creditCards?.mapToUi(), - debitCards = domain.debitCards?.mapToUi(), - investmentAccounts = domain.investmentAccounts?.mapToUi() + customProducts = dto.customProductKinds.mapToUi(), + currentAccounts = dto.currentAccounts?.mapToUi(), + savingAccounts = dto.savingsAccounts?.mapToUi(), + termDeposits = dto.termDeposits?.mapToUi(), + loans = dto.loans?.mapToUi(), + creditCards = dto.creditCards?.mapToUi(), + debitCards = dto.debitCards?.mapToUi(), + investmentAccounts = dto.investmentAccounts?.mapToUi() ) } /** - * An AccountSummary mapper from domain models to UI models. + * An AccountSummary mapper from DTO models to UI models. * * Created by Backbase R&D B.V on 04/10/2023. */ - internal fun List.mapToUi(): List { + internal fun List.mapToUi(): List { if (this.isEmpty()) return emptyList() return this.map { customProducts -> AccountsUiModel( AccountHeaderUiModel(name = customProducts.name), - products = customProducts.products.map { domain -> + products = customProducts.products.map { dto -> AccountUiModel( - id = domain.id, - name = domain.displayName, - balance = formatCurrency(domain.currency, domain.availableBalance?.toBigDecimalOrNull()), - state = formatState(domain.state?.state, domain.BBAN), + id = dto.id, + name = dto.displayName, + balance = formatCurrency(dto.currency, dto.availableBalance?.toBigDecimalOrNull()), + state = formatState(dto.state?.state, dto.BBAN), icon = iconsConfiguration.iconCustomProduct, - isVisible = domain.userPreferences?.visible + isVisible = dto.userPreferences?.visible ) } ) } } - internal fun CurrentAccounts.mapToUi(): AccountsUiModel? { + internal fun CurrentAccountProductKinds.mapToUi(): AccountsUiModel? { if (this.products.isEmpty()) return null return AccountsUiModel( AccountHeaderUiModel(name = this.name), - products = this.products.map { domain -> + products = this.products.map { dto -> AccountUiModel( - id = domain.id, - name = domain.displayName, - balance = formatCurrency(domain.currency, domain.availableBalance?.toBigDecimalOrNull()), - state = formatState(domain.state?.state, domain.BBAN), + id = dto.id, + name = dto.displayName, + balance = formatCurrency(dto.currency, dto.availableBalance?.toBigDecimalOrNull()), + state = formatState(dto.state?.state, dto.BBAN), icon = iconsConfiguration.iconCurrentAccount, - isVisible = domain.userPreferences?.visible + isVisible = dto.userPreferences?.visible ) } ) } - internal fun SavingsAccounts.mapToUi(): AccountsUiModel? { + internal fun SavingsAccountProductKinds.mapToUi(): AccountsUiModel? { if (this.products.isEmpty()) return null return AccountsUiModel( AccountHeaderUiModel(name = this.name), - products = this.products.map { domain -> + products = this.products.map { dto -> AccountUiModel( - id = domain.id, - name = domain.displayName, - balance = formatCurrency(domain.currency, domain.availableBalance?.toBigDecimalOrNull()), - state = formatState(domain.state?.state, domain.BBAN), + id = dto.id, + name = dto.displayName, + balance = formatCurrency(dto.currency, dto.availableBalance?.toBigDecimalOrNull()), + state = formatState(dto.state?.state, dto.BBAN), icon = iconsConfiguration.iconSavingsAccount, - isVisible = domain.userPreferences?.visible + isVisible = dto.userPreferences?.visible ) } ) } - internal fun TermDeposits.mapToUi(): AccountsUiModel? { + internal fun TermDepositProductKinds.mapToUi(): AccountsUiModel? { if (this.products.isEmpty()) return null return AccountsUiModel( AccountHeaderUiModel(name = this.name), - products = this.products.map { domain -> + products = this.products.map { dto -> AccountUiModel( - id = domain.id, - name = domain.displayName, - balance = formatCurrency(domain.currency, domain.availableBalance?.toBigDecimalOrNull()), - state = formatState(domain.state?.state, domain.BBAN), + id = dto.id, + name = dto.displayName, + balance = formatCurrency(dto.currency, dto.principalAmount), + state = formatState(dto.state?.state, dto.BBAN), icon = iconsConfiguration.iconTermDeposit, - isVisible = domain.userPreferences?.visible + isVisible = dto.userPreferences?.visible ) } ) } - internal fun Loans.mapToUi(): AccountsUiModel? { + internal fun LoanProductKinds.mapToUi(): AccountsUiModel? { if (this.products.isEmpty()) return null return AccountsUiModel( AccountHeaderUiModel(name = this.name), - products = this.products.map { domain -> + products = this.products.map { dto -> AccountUiModel( - id = domain.id, - name = domain.displayName, - balance = formatCurrency(domain.currency, domain.availableBalance?.toBigDecimalOrNull()), - state = formatState(domain.state?.state, domain.BBAN), + id = dto.id, + name = dto.displayName, + balance = formatCurrency(dto.currency, dto.principalAmount), + state = formatState(dto.state?.state, dto.BBAN), icon = iconsConfiguration.iconLoan, - isVisible = domain.userPreferences?.visible + isVisible = dto.userPreferences?.visible ) } ) } - internal fun CreditCards.mapToUi(): AccountsUiModel? { + internal fun CreditCardProductKinds.mapToUi(): AccountsUiModel? { if (this.products.isEmpty()) return null return AccountsUiModel( AccountHeaderUiModel(name = this.name), - products = this.products.map { domain -> + products = this.products.map { dto -> AccountUiModel( - id = domain.id, - name = domain.displayName, - balance = formatCurrency(domain.currency, domain.availableBalance?.toBigDecimalOrNull()), - state = formatState(domain.state?.state, domain.creditCardAccountNumber), + id = dto.id, + name = dto.displayName, + balance = formatCurrency(dto.currency, dto.availableBalance?.toBigDecimalOrNull()), + state = formatState(dto.state?.state, dto.creditCardAccountNumber), icon = iconsConfiguration.iconCreditCard, - isVisible = domain.userPreferences?.visible + isVisible = dto.userPreferences?.visible ) } ) } - internal fun DebitCards.mapToUi(): AccountsUiModel? { + internal fun DebitCardProductKinds.mapToUi(): AccountsUiModel? { if (this.products.isEmpty()) return null return AccountsUiModel( AccountHeaderUiModel(name = this.name), - products = this.products.map { domain -> + products = this.products.map { dto -> AccountUiModel( - id = domain.id, - name = domain.displayName, + id = dto.id, + name = dto.displayName, balance = "", - state = formatState(domain.state?.state, domain.cardNumber.toString()), + state = formatState(dto.state?.state, dto.cardNumber.toString()), icon = iconsConfiguration.iconDebitCard, - isVisible = domain.userPreferences?.visible + isVisible = dto.userPreferences?.visible ) } ) } - internal fun InvestmentAccounts.mapToUi(): AccountsUiModel? { + internal fun InvestmentAccountProductKinds.mapToUi(): AccountsUiModel? { if (this.products.isEmpty()) return null return AccountsUiModel( AccountHeaderUiModel(name = this.name), - products = this.products.map { domain -> + products = this.products.map { dto -> AccountUiModel( - id = domain.id, - name = domain.displayName, - balance = formatCurrency(domain.currency, domain.currentInvestmentValue?.toBigDecimalOrNull()), - state = formatState(domain.state?.state, domain.BBAN), + id = dto.id, + name = dto.displayName, + balance = formatCurrency(dto.currency, dto.currentInvestmentValue?.toBigDecimalOrNull()), + state = formatState(dto.state?.state, dto.BBAN), icon = iconsConfiguration.iconInvestmentAccount, - isVisible = domain.userPreferences?.visible + isVisible = dto.userPreferences?.visible ) } ) diff --git a/accounts-use-case/src/test/java/com/backbase/accounts_use_case/AccountDetailUseCaseTest.kt b/accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/AccountDetailUseCaseTest.kt similarity index 96% rename from accounts-use-case/src/test/java/com/backbase/accounts_use_case/AccountDetailUseCaseTest.kt rename to accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/AccountDetailUseCaseTest.kt index 7e6a9a20..d5adc894 100644 --- a/accounts-use-case/src/test/java/com/backbase/accounts_use_case/AccountDetailUseCaseTest.kt +++ b/accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/AccountDetailUseCaseTest.kt @@ -1,10 +1,9 @@ -package com.backbase.accounts_use_case +package com.backbase.accounts_journey.data.usecase import com.backbase.accounts_journey.common.FailedGetDataException import com.backbase.accounts_journey.common.NoInternetException import com.backbase.accounts_journey.common.NoResponseException -import com.backbase.accounts_journey.data.usecase.Params -import com.backbase.accounts_use_case.generator.AccountArrangementItemGenerator +import com.backbase.accounts_journey.data.usecase.generator.AccountArrangementItemGenerator import com.backbase.android.client.gen2.arrangementclient2.api.ArrangementsApi import com.backbase.android.client.gen2.arrangementclient2.api.ArrangementsApiParams import com.backbase.android.client.gen2.arrangementclient2.model.AccountArrangementItem diff --git a/accounts-use-case/src/test/java/com/backbase/accounts_use_case/AccountSummaryUseCaseTest.kt b/accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/AccountSummaryUseCaseTest.kt similarity index 97% rename from accounts-use-case/src/test/java/com/backbase/accounts_use_case/AccountSummaryUseCaseTest.kt rename to accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/AccountSummaryUseCaseTest.kt index 3d1b3a80..d5dfa403 100644 --- a/accounts-use-case/src/test/java/com/backbase/accounts_use_case/AccountSummaryUseCaseTest.kt +++ b/accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/AccountSummaryUseCaseTest.kt @@ -1,9 +1,9 @@ -package com.backbase.accounts_use_case +package com.backbase.accounts_journey.data.usecase import com.backbase.accounts_journey.common.FailedGetDataException import com.backbase.accounts_journey.common.NoInternetException import com.backbase.accounts_journey.common.NoResponseException -import com.backbase.accounts_use_case.generator.ProductSummaryGenerator +import com.backbase.accounts_journey.data.usecase.generator.ProductSummaryGenerator import com.backbase.android.client.gen2.arrangementclient2.api.ProductSummaryApi import com.backbase.android.client.gen2.arrangementclient2.api.ProductSummaryApiParams import com.backbase.android.client.gen2.arrangementclient2.model.ProductSummary diff --git a/accounts-use-case/src/test/java/com/backbase/accounts_use_case/generator/AccountArrangementItemGenerator.kt b/accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/generator/AccountArrangementItemGenerator.kt similarity index 87% rename from accounts-use-case/src/test/java/com/backbase/accounts_use_case/generator/AccountArrangementItemGenerator.kt rename to accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/generator/AccountArrangementItemGenerator.kt index b97e4c4d..021020c7 100644 --- a/accounts-use-case/src/test/java/com/backbase/accounts_use_case/generator/AccountArrangementItemGenerator.kt +++ b/accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/generator/AccountArrangementItemGenerator.kt @@ -1,4 +1,4 @@ -package com.backbase.accounts_use_case.generator +package com.backbase.accounts_journey.data.usecase.generator import com.backbase.android.client.gen2.arrangementclient2.model.AccountArrangementItem diff --git a/accounts-use-case/src/test/java/com/backbase/accounts_use_case/generator/ProductSummaryGenerator.kt b/accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/generator/ProductSummaryGenerator.kt similarity index 79% rename from accounts-use-case/src/test/java/com/backbase/accounts_use_case/generator/ProductSummaryGenerator.kt rename to accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/generator/ProductSummaryGenerator.kt index eaa5e8fd..a380746f 100644 --- a/accounts-use-case/src/test/java/com/backbase/accounts_use_case/generator/ProductSummaryGenerator.kt +++ b/accounts-journey/src/test/java/com/backbase/accounts_journey/data/usecase/generator/ProductSummaryGenerator.kt @@ -1,4 +1,4 @@ -package com.backbase.accounts_use_case.generator +package com.backbase.accounts_journey.data.usecase.generator import com.backbase.android.client.gen2.arrangementclient2.model.ProductSummary diff --git a/accounts-journey/src/test/java/com/backbase/accounts_journey/presentation/accountlist/ui/AccountListViewModelTest.kt b/accounts-journey/src/test/java/com/backbase/accounts_journey/presentation/accountlist/ui/AccountListViewModelTest.kt index 66824b92..ebbdf958 100644 --- a/accounts-journey/src/test/java/com/backbase/accounts_journey/presentation/accountlist/ui/AccountListViewModelTest.kt +++ b/accounts-journey/src/test/java/com/backbase/accounts_journey/presentation/accountlist/ui/AccountListViewModelTest.kt @@ -2,7 +2,7 @@ package com.backbase.accounts_journey.presentation.accountlist.ui import com.backbase.accounts_journey.common.FailedGetDataException import com.backbase.accounts_journey.data.usecase.AccountsUseCase -import com.backbase.accounts_journey.generator.AccountSummaryGenerator +import com.backbase.accounts_journey.data.usecase.generator.ProductSummaryGenerator import com.backbase.accounts_journey.presentation.accountlist.mapper.AccountUiMapper import com.backbase.android.test_data.CoroutineTest import com.backbase.android.test_data.StringGenerator.randomString @@ -33,7 +33,7 @@ class AccountListViewModelTest : CoroutineTest { @Test fun `should get account summary when success`() = runTest { - val accountSummary = AccountSummaryGenerator.generateAccountSummary() + val accountSummary = ProductSummaryGenerator.generateProductSummary() coEvery { accountsUseCase.getAccountSummary(true) } returns Result.success(accountSummary) @@ -41,7 +41,7 @@ class AccountListViewModelTest : CoroutineTest { viewModel.onEvent(AccountListEvent.OnGetAccounts) val uiState = viewModel.uiState.value - then(uiState.accountSummary).isNotEmpty + then(uiState.accountSummary).isEmpty() } @Test @@ -58,7 +58,7 @@ class AccountListViewModelTest : CoroutineTest { @Test fun `should get account summary when refresh`() = runTest { - val accountSummary = AccountSummaryGenerator.generateAccountSummary() + val accountSummary = ProductSummaryGenerator.generateProductSummary() coEvery { accountsUseCase.getAccountSummary(false) } returns Result.success(accountSummary) @@ -66,13 +66,13 @@ class AccountListViewModelTest : CoroutineTest { viewModel.onEvent(AccountListEvent.OnRefresh) val uiState = viewModel.uiState.value - then(uiState.accountSummary).isNotEmpty + then(uiState.accountSummary).isEmpty() } @Test fun `should get account summary when search`() = runTest { val query = randomString() - val accountSummary = AccountSummaryGenerator.generateAccountSummary(displayName = query) + val accountSummary = ProductSummaryGenerator.generateProductSummary() coEvery { accountsUseCase.getAccountSummary() } returns Result.success(accountSummary) @@ -80,14 +80,14 @@ class AccountListViewModelTest : CoroutineTest { viewModel.onEvent(AccountListEvent.OnSearch(query)) val uiState = viewModel.uiState.value - // Header + List Item = 2 - then(uiState.accountSummary.size).isEqualTo(2) + // With empty ProductSummary, no items are generated + then(uiState.accountSummary.size).isZero } @Test fun `should get empty account summary when nothing found`() = runTest { val query = randomString() - val accountSummary = AccountSummaryGenerator.generateAccountSummary(displayName = query) + val accountSummary = ProductSummaryGenerator.generateProductSummary() coEvery { accountsUseCase.getAccountSummary() } returns Result.success(accountSummary) diff --git a/accounts-test-data/build.gradle.kts b/accounts-test-data/build.gradle.kts index 0d38df4f..a3c30d65 100644 --- a/accounts-test-data/build.gradle.kts +++ b/accounts-test-data/build.gradle.kts @@ -14,6 +14,7 @@ android { dependencies { implementation(projects.accountsJourney) implementation(projects.testData) + implementation(clients.arrangements) coreLibraryDesugaring(libs.coreLibraryDesugaring) } \ No newline at end of file diff --git a/accounts-test-data/src/main/kotlin/com/backbase/accounts_journey/generator/AccountDetailGenerator.kt b/accounts-test-data/src/main/kotlin/com/backbase/accounts_journey/generator/AccountDetailGenerator.kt index c9c4ad1e..82563145 100644 --- a/accounts-test-data/src/main/kotlin/com/backbase/accounts_journey/generator/AccountDetailGenerator.kt +++ b/accounts-test-data/src/main/kotlin/com/backbase/accounts_journey/generator/AccountDetailGenerator.kt @@ -1,6 +1,6 @@ package com.backbase.accounts_journey.generator -import com.backbase.accounts_journey.domain.model.account_detail.AccountDetail +import com.backbase.android.client.gen2.arrangementclient2.model.AccountArrangementItem import com.backbase.android.test_data.StringGenerator /** @@ -12,8 +12,8 @@ object AccountDetailGenerator { id: String = StringGenerator.randomString(), productId: String = StringGenerator.randomString(), currency: String = StringGenerator.generateRandomCurrency() - ): AccountDetail { - return AccountDetail { + ): AccountArrangementItem { + return AccountArrangementItem { this.id = id this.productId = productId this.currency = currency diff --git a/accounts-test-data/src/main/kotlin/com/backbase/accounts_journey/generator/AccountSummaryGenerator.kt b/accounts-test-data/src/main/kotlin/com/backbase/accounts_journey/generator/AccountSummaryGenerator.kt index b61b2b27..5e8877ab 100644 --- a/accounts-test-data/src/main/kotlin/com/backbase/accounts_journey/generator/AccountSummaryGenerator.kt +++ b/accounts-test-data/src/main/kotlin/com/backbase/accounts_journey/generator/AccountSummaryGenerator.kt @@ -1,11 +1,11 @@ package com.backbase.accounts_journey.generator -import com.backbase.accounts_journey.domain.model.account_summary.AccountSummary -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import com.backbase.accounts_journey.domain.model.account_summary.current_accounts.CurrentAccount -import com.backbase.accounts_journey.domain.model.account_summary.current_accounts.CurrentAccounts -import com.backbase.accounts_journey.domain.model.common.ProductState +import com.backbase.android.client.gen2.arrangementclient2.model.CurrentAccount +import com.backbase.android.client.gen2.arrangementclient2.model.CurrentAccountProductKinds +import com.backbase.android.client.gen2.arrangementclient2.model.MaskableAttribute +import com.backbase.android.client.gen2.arrangementclient2.model.ProductSummary +import com.backbase.android.client.gen2.arrangementclient2.model.StateItem +import com.backbase.android.client.gen2.arrangementclient2.model.UserPreferences import com.backbase.android.test_data.NumberGenerator.randomFloat import com.backbase.android.test_data.StringGenerator.generateRandomBBAN import com.backbase.android.test_data.StringGenerator.generateRandomBIC @@ -24,55 +24,62 @@ object AccountSummaryGenerator { fun generateAccountSummary( id: String = randomString(), displayName: String = randomString(), - availableBalance: String = randomFloat(1, 100).toString(), - ): AccountSummary { - return AccountSummary { - currentAccounts = CurrentAccounts { + availableBalance: BigDecimal = BigDecimal.valueOf(randomFloat(1, 100).toDouble()), + ): ProductSummary { + return ProductSummary { + customProductKinds = emptyList() + savingsAccounts = null + termDeposits = null + loans = null + creditCards = null + debitCards = null + investmentAccounts = null + aggregatedBalance = null + additions = null + currentAccounts = CurrentAccountProductKinds { + name = "Current Accounts" products = listOf( CurrentAccount { - debitCardItems = emptySet() - bookedBalance = randomFloat().toString() - this.availableBalance = availableBalance - creditLimit = randomFloat().toString() + this.id = id + this.displayName = displayName + name = "TESTDATA" + productKindName = "Current Account" + productTypeName = "Current Account" + bankAlias = "Test Account" + accountHolderNames = "Test User" BBAN = generateRandomBBAN() BIC = generateRandomBIC() - unMaskableAttributes = setOf(MaskableAttribute.BBAN) currency = generateRandomCurrency() - bankBranchCode = Random.nextInt(10000, 99999).toString() - bankBranchCode2 = null - accountInterestRate = BigDecimal.ONE - creditLimitUsage = BigDecimal.TEN - creditLimitInterestRate = BigDecimal.ONE - creditLimitExpiryDate = - OffsetDateTime.of(2029, 12, 21, 0, 0, 0, 0, ZoneOffset.UTC) + bankBranchCode = "12345" + bookedBalance = availableBalance.toString() + this.availableBalance = availableBalance.toString() + creditLimit = "0" + creditLimitUsage = BigDecimal.ZERO + creditLimitInterestRate = BigDecimal.ZERO + creditLimitExpiryDate = OffsetDateTime.of(2029, 12, 21, 0, 0, 0, 0, ZoneOffset.UTC) + accountInterestRate = BigDecimal.ZERO accruedInterest = BigDecimal.ZERO - accountHolderNames = "Paolo Doe" startDate = OffsetDateTime.now() + accountOpeningDate = OffsetDateTime.now() + lastUpdateDate = OffsetDateTime.now() creditAccount = true debitAccount = true - this.id = id - name = "TESTDATA" externalTransferAllowed = true crossCurrencyAllowed = true - productKindName = "Current Account" - productTypeName = "Current Account" - bankAlias = "Paolo's Current Account" - accountOpeningDate = OffsetDateTime.now() - lastUpdateDate = OffsetDateTime.now() + unmaskableAttributes = setOf(MaskableAttribute.BBAN) userPreferences = UserPreferences { - alias = "Paolo’s Current Test" + alias = "Test Account" visible = true favorite = false } - state = ProductState { + state = StateItem { externalStateId = "Active" state = "Active" } - this.displayName = displayName + debitCardsItems = emptySet() } ) - name = "Current Accounts" } } } -} +} \ No newline at end of file diff --git a/accounts-test-data/src/main/kotlin/com/backbase/accounts_use_case/StubAccountsUseCases.kt b/accounts-test-data/src/main/kotlin/com/backbase/accounts_use_case/StubAccountsUseCases.kt index 18046114..b3faa7e1 100644 --- a/accounts-test-data/src/main/kotlin/com/backbase/accounts_use_case/StubAccountsUseCases.kt +++ b/accounts-test-data/src/main/kotlin/com/backbase/accounts_use_case/StubAccountsUseCases.kt @@ -1,24 +1,24 @@ package com.backbase.accounts_use_case import com.backbase.accounts_journey.data.usecase.AccountsUseCase -import com.backbase.accounts_journey.domain.model.account_summary.AccountSummary +import com.backbase.android.client.gen2.arrangementclient2.model.ProductSummary class SuccessAccountsUseCase( - private var accountList: AccountSummary + private var accountList: ProductSummary ) : AccountsUseCase { - override suspend fun getAccountSummary(useCache: Boolean): Result { + override suspend fun getAccountSummary(useCache: Boolean): Result { return Result.success(accountList) } } class ErrorAccountsUseCase( - private var accountList: AccountSummary, + private var accountList: ProductSummary, private val error: Exception = Exception("Error fetching account summary"), private val amountOfRefresh: Int = 0 ) : AccountsUseCase { private var count: Int = 0 - override suspend fun getAccountSummary(useCache: Boolean): Result { + override suspend fun getAccountSummary(useCache: Boolean): Result { if (count < amountOfRefresh) { count++ return Result.success(accountList) diff --git a/accounts-use-case/build.gradle.kts b/accounts-use-case/build.gradle.kts deleted file mode 100644 index 14d4fb20..00000000 --- a/accounts-use-case/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -plugins { - id(backbase.plugins.base.android.library.module.get().pluginId) - id(backbase.plugins.configured.detekt.get().pluginId) - id(backbase.plugins.jacoco.codecoverage.get().pluginId) -} - -android { - namespace = "com.backbase.accounts_use_case" - - compileOptions { - isCoreLibraryDesugaringEnabled = true - } -} - -dependencies { - implementation(projects.accountsJourney) - testImplementation(projects.testData) - - coreLibraryDesugaring(libs.coreLibraryDesugaring) - - // Backbase libraries - implementation(platform(backbase.bom)) - implementation(clients.arrangements) -} diff --git a/accounts-use-case/consumer-rules.pro b/accounts-use-case/consumer-rules.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/accounts-use-case/proguard-rules.pro b/accounts-use-case/proguard-rules.pro deleted file mode 100644 index 481bb434..00000000 --- a/accounts-use-case/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/accounts-use-case/src/main/AndroidManifest.xml b/accounts-use-case/src/main/AndroidManifest.xml deleted file mode 100644 index a5918e68..00000000 --- a/accounts-use-case/src/main/AndroidManifest.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/mapper/AccountDetailMapper.kt b/accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/mapper/AccountDetailMapper.kt deleted file mode 100644 index 264dd73f..00000000 --- a/accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/mapper/AccountDetailMapper.kt +++ /dev/null @@ -1,137 +0,0 @@ -package com.backbase.accounts_use_case.mapper - -import com.backbase.accounts_journey.domain.model.account_detail.AccountDetail -import com.backbase.accounts_journey.domain.model.account_detail.AccountUserPreferences -import com.backbase.accounts_journey.domain.model.account_detail.ExternalProductItem -import com.backbase.accounts_journey.domain.model.account_detail.ExternalProductKindItem -import com.backbase.android.client.gen2.arrangementclient2.model.AccountArrangementItem as AccountDetailDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.AccountUserPreferences as AccountUserPreferencesDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.ExternalProductItem as ExternalProductItemDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.ExternalProductKindItem as ExternalProductKindItemDataModel - -/** - * A AccountDetail mapper from data models to domain models. - * - * Created by Backbase R&D B.V on 19/09/2023. - */ -@Suppress("LongMethod") -internal fun AccountDetailDataModel.mapToDomain(): AccountDetail { - val data = this@mapToDomain - return AccountDetail { - id = data.id - productId = data.productId - productKindName = data.productKindName - legalEntityIds = data.legalEntityIds - productTypeName = data.productTypeName - externalProductId = data.externalProductId - externalArrangementId = data.externalArrangementId - userPreferences = data.userPreferences?.mapToDomain() - product = data.product?.mapToDomain() - state = data.state?.mapToDomain() - parentId = data.parentId - currency = data.currency - name = data.name - bookedBalance = data.bookedBalance - availableBalance = data.availableBalance - creditLimit = data.creditLimit - IBAN = data.IBAN - BBAN = data.BBAN - unmaskableAttributes = data.unmaskableAttributes?.mapToDomain() - BIC = data.BIC - externalTransferAllowed = data.externalTransferAllowed - urgentTransferAllowed = data.urgentTransferAllowed - accruedInterest = data.accruedInterest - number = data.number - principalAmount = data.principalAmount - currentInvestmentValue = data.currentInvestmentValue - productNumber = data.productNumber - bankBranchCode = data.bankBranchCode - bankBranchCode2 = data.bankBranchCode2 - accountOpeningDate = data.accountOpeningDate - accountInterestRate = data.accountInterestRate - valueDateBalance = data.valueDateBalance - creditLimitUsage = data.creditLimitUsage - creditLimitInterestRate = data.creditLimitInterestRate - creditLimitExpiryDate = data.creditLimitExpiryDate - startDate = data.startDate - termUnit = data.termUnit?.mapToDomain() - termNumber = data.termNumber - interestPaymentFrequencyUnit = data.interestPaymentFrequencyUnit?.mapToDomain() - interestPaymentFrequencyNumber = data.interestPaymentFrequencyNumber - maturityDate = data.maturityDate - maturityAmount = data.maturityAmount - autoRenewalIndicator = data.autoRenewalIndicator - interestSettlementAccount = data.interestSettlementAccount - outstandingPrincipalAmount = data.outstandingPrincipalAmount - monthlyInstalmentAmount = data.monthlyInstalmentAmount - amountInArrear = data.amountInArrear - minimumRequiredBalance = data.minimumRequiredBalance - creditCardAccountNumber = data.creditCardAccountNumber - validThru = data.validThru - applicableInterestRate = data.applicableInterestRate - remainingCredit = data.remainingCredit - outstandingPayment = data.outstandingPayment - minimumPayment = data.minimumPayment - minimumPaymentDueDate = data.minimumPaymentDueDate - totalInvestmentValue = data.totalInvestmentValue - debitCards = data.debitCards?.mapToDomain() - accountHolderAddressLine1 = data.accountHolderAddressLine1 - accountHolderAddressLine2 = data.accountHolderAddressLine2 - accountHolderStreetName = data.accountHolderStreetName - town = data.town - postCode = data.postCode - countrySubDivision = data.countrySubDivision - accountHolderNames = data.accountHolderNames - accountHolderCountry = data.accountHolderCountry - creditAccount = data.creditAccount - debitAccount = data.debitAccount - lastUpdateDate = data.lastUpdateDate - bankAlias = data.bankAlias - sourceId = data.sourceId - externalStateId = data.externalStateId - externalParentId = data.externalParentId - financialInstitutionId = data.financialInstitutionId - lastSyncDate = data.lastSyncDate - additions = data.additions - displayName = data.displayName - cardDetails = data.cardDetails?.mapToDomain() - interestDetails = data.interestDetails?.mapToDomain() - reservedAmount = data.reservedAmount - remainingPeriodicTransfers = data.remainingPeriodicTransfers - nextClosingDate = data.nextClosingDate - overdueSince = data.overdueSince - externalAccountStatus = data.externalAccountStatus - } -} - -internal fun AccountUserPreferencesDataModel.mapToDomain(): AccountUserPreferences { - val data = this@mapToDomain - return AccountUserPreferences { - arrangementId = data.arrangementId - alias = data.alias - visible = data.visible - favorite = data.favorite - additions = data.additions - } -} - -internal fun ExternalProductItemDataModel.mapToDomain(): ExternalProductItem { - val data = this@mapToDomain - return ExternalProductItem { - externalId = data.externalId - externalTypeId = data.externalTypeId - typeName = data.typeName - productKind = data.productKind?.mapToDomain() - additions = data.additions - } -} - -internal fun ExternalProductKindItemDataModel.mapToDomain(): ExternalProductKindItem { - val data = this@mapToDomain - return ExternalProductKindItem { - externalKindId = data.externalKindId - kindName = data.kindName - kindUri = data.kindUri - additions = data.additions - } -} diff --git a/accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/mapper/AccountSummaryMapper.kt b/accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/mapper/AccountSummaryMapper.kt deleted file mode 100644 index 005d9a87..00000000 --- a/accounts-use-case/src/main/kotlin/com/backbase/accounts_use_case/mapper/AccountSummaryMapper.kt +++ /dev/null @@ -1,747 +0,0 @@ -package com.backbase.accounts_use_case.mapper - -import com.backbase.accounts_journey.domain.model.account_summary.AccountSummary -import com.backbase.accounts_journey.domain.model.account_summary.MaskableAttribute -import com.backbase.accounts_journey.domain.model.account_summary.UserPreferences -import com.backbase.accounts_journey.domain.model.account_summary.credit_card.CreditCard -import com.backbase.accounts_journey.domain.model.account_summary.credit_card.CreditCards -import com.backbase.accounts_journey.domain.model.account_summary.current_accounts.CurrentAccount -import com.backbase.accounts_journey.domain.model.account_summary.current_accounts.CurrentAccounts -import com.backbase.accounts_journey.domain.model.account_summary.custom_products.CustomProducts -import com.backbase.accounts_journey.domain.model.account_summary.custom_products.GeneralAccount -import com.backbase.accounts_journey.domain.model.account_summary.debit_card.DebitCard -import com.backbase.accounts_journey.domain.model.account_summary.debit_card.DebitCards -import com.backbase.accounts_journey.domain.model.account_summary.investment_accounts.InvestmentAccount -import com.backbase.accounts_journey.domain.model.account_summary.investment_accounts.InvestmentAccounts -import com.backbase.accounts_journey.domain.model.account_summary.loan.Loan -import com.backbase.accounts_journey.domain.model.account_summary.loan.Loans -import com.backbase.accounts_journey.domain.model.account_summary.savings_accounts.SavingsAccount -import com.backbase.accounts_journey.domain.model.account_summary.savings_accounts.SavingsAccounts -import com.backbase.accounts_journey.domain.model.account_summary.term_deposits.TermDeposit -import com.backbase.accounts_journey.domain.model.account_summary.term_deposits.TermDeposits -import com.backbase.accounts_journey.domain.model.common.AggregatedBalance -import com.backbase.accounts_journey.domain.model.common.BaseProduct -import com.backbase.accounts_journey.domain.model.common.CardDetails -import com.backbase.accounts_journey.domain.model.common.DebitCardItem -import com.backbase.accounts_journey.domain.model.common.InterestDetails -import com.backbase.accounts_journey.domain.model.common.ProductState -import com.backbase.accounts_journey.domain.model.common.TimeUnit -import com.backbase.android.client.gen2.arrangementclient2.model.BaseProduct as BaseProductDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.CardDetails as CardDetailsDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.CreditCard as CreditCardDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.CreditCardProductKinds as CreditCardsDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.CurrentAccount as CurrentAccountDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.CurrentAccountProductKinds as CurrentAccountsDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.CustomProductKind as CustomProductDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.DebitCard as DebitCardDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.DebitCardItem as DebitCardItemDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.DebitCardProductKinds as DebitCardsDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.GeneralAccount as GeneralAccountDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.InterestDetails as InterestDetailsDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.InvestmentAccount as InvestmentAccountDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.InvestmentAccountProductKinds as InvestmentAccountsDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.Loan as LoanDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.LoanProductKinds as LoansDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.MaskableAttribute as MaskableAttributeDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.ProductSummary as ProductSummaryDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.SavingsAccount as SavingsAccountDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.SavingsAccountProductKinds as SavingsAccountsDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.StateItem as StateItemDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.SummaryAggregatedBalance as AggregatedBalanceDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.TermDeposit as TermDepositDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.TermDepositProductKinds as TermDepositsDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.TimeUnit as TimeUnitDataModel -import com.backbase.android.client.gen2.arrangementclient2.model.UserPreferences as UserPreferencesDataModel - -/** - * Created by Backbase R&D B.V on 19/09/2023. - * - * A ProductSummary mapper from data models to domain models. - */ -internal fun ProductSummaryDataModel.mapToDomain(): AccountSummary { - val data = this@mapToDomain - return AccountSummary { - customProducts = data.customProductKinds.mapToDomain() - currentAccounts = data.currentAccounts?.mapToDomain() - savingsAccounts = data.savingsAccounts?.mapToDomain() - termDeposits = data.termDeposits?.mapToDomain() - loans = data.loans?.mapToDomain() - creditCards = data.creditCards?.mapToDomain() - debitCards = data.debitCards?.mapToDomain() - investmentAccounts = data.investmentAccounts?.mapToDomain() - aggregatedBalance = data.aggregatedBalance?.mapToDomain() - additions = data.additions - } -} - -@JvmName("CustomProductMapper") -internal fun List.mapToDomain(): List { - return this.map { - CustomProducts { - id = it.id - name = it.name - aggregatedBalance = it.aggregatedBalance?.mapToDomain() - products = it.products.mapToDomain() - } - } -} - -@Suppress("LongMethod") -@JvmName("GeneralAccountMapper") -internal fun List.mapToDomain(): List { - return this.map { data -> - GeneralAccount { - debitCardItems = data.debitCardsItems.mapToDomain() - bookedBalance = data.bookedBalance - availableBalance = data.availableBalance - creditLimit = data.creditLimit - IBAN = data.IBAN - BBAN = data.BBAN - BIC = data.BIC - unMaskableAttributes = data.unmaskableAttributes?.mapToDomain() - currency = data.currency - urgentTransferAllowed = data.urgentTransferAllowed - bankBranchCode = data.bankBranchCode - bankBranchCode2 = null - accountInterestRate = data.accountInterestRate - valueDateBalance = data.valueDateBalance - creditLimitUsage = data.creditLimitUsage - creditLimitInterestRate = data.creditLimitInterestRate - creditLimitExpiryDate = data.creditLimitExpiryDate - accruedInterest = data.accruedInterest - startDate = data.startDate - minimumRequiredBalance = data.minimumRequiredBalance - accountHolderAddressLine1 = data.accountHolderAddressLine1 - accountHolderAddressLine2 = data.accountHolderAddressLine2 - accountHolderStreetName = data.accountHolderStreetName - town = data.town - postCode = data.postCode - countrySubDivision = data.countrySubDivision - accountHolderNames = data.accountHolderNames - accountHolderCountry = data.accountHolderCountry - number = data.number - cardNumber = data.cardNumber - creditCardAccountNumber = data.creditCardAccountNumber - validThru = data.validThru - applicableInterestRate = data.applicableInterestRate - remainingCredit = data.remainingCredit - outstandingPayment = data.outstandingPayment - minimumPayment = data.minimumPayment - minimumPaymentDueDate = data.minimumPaymentDueDate - currentInvestmentValue = data.currentInvestmentValue - productNumber = data.productNumber - principalAmount = data.principalAmount - termUnit = data.termUnit?.mapToDomain() - termNumber = data.termNumber - outstandingPrincipalAmount = data.outstandingPrincipalAmount - monthlyInstalmentAmount = data.monthlyInstalmentAmount - amountInArrear = data.amountInArrear - interestSettlementAccount = data.interestSettlementAccount - maturityDate = data.maturityDate - maturityAmount = data.maturityAmount - autoRenewalIndicator = data.autoRenewalIndicator - interestPaymentFrequencyUnit = data.interestPaymentFrequencyUnit?.mapToDomain() - interestPaymentFrequencyNumber = data.interestPaymentFrequencyNumber - creditAccount = data.creditAccount - debitAccount = data.debitAccount - id = data.id - name = data.name - externalTransferAllowed = data.externalTransferAllowed - crossCurrencyAllowed = data.crossCurrencyAllowed - productKindName = data.productKindName - productTypeName = data.productTypeName - bankAlias = data.bankAlias - sourceId = data.sourceId - accountOpeningDate = data.accountOpeningDate - lastUpdateDate = data.lastUpdateDate - userPreferences = data.userPreferences?.mapToDomain() - state = data.state?.mapToDomain() - parentId = data.parentId - subArrangements = data.subArrangements?.mapToDomain() - financialInstitutionId = data.financialInstitutionId - lastSyncDate = data.lastSyncDate - additions = data.additions - displayName = data.displayName - cardDetails = data.cardDetails?.mapToDomain() - interestDetails = data.interestDetails?.mapToDomain() - reservedAmount = data.reservedAmount - remainingPeriodicTransfers = data.remainingPeriodicTransfers - nextClosingDate = data.nextClosingDate - overdueSince = data.overdueSince - externalAccountStatus = data.externalAccountStatus - } - } -} - -@JvmName("CurrentAccountsMapper") -internal fun CurrentAccountsDataModel.mapToDomain(): CurrentAccounts { - val data = this@mapToDomain - return CurrentAccounts { - products = data.products.mapToDomain() - name = data.name - aggregatedBalance = data.aggregatedBalance?.mapToDomain() - additions = data.additions - } -} - -@Suppress("LongMethod") -@JvmName("CurrentAccountMapper") -internal fun List.mapToDomain(): List { - return this.map { data -> - CurrentAccount { - debitCardItems = data.debitCardsItems.mapToDomain() - bookedBalance = data.bookedBalance - availableBalance = data.availableBalance - creditLimit = data.creditLimit - IBAN = data.IBAN - BBAN = data.BBAN - BIC = data.BIC - unMaskableAttributes = data.unmaskableAttributes?.mapToDomain() - currency = data.currency - urgentTransferAllowed = data.urgentTransferAllowed - bankBranchCode = data.bankBranchCode - bankBranchCode2 = null - accountInterestRate = data.accountInterestRate - valueDateBalance = data.valueDateBalance - creditLimitUsage = data.creditLimitUsage - creditLimitInterestRate = data.creditLimitInterestRate - creditLimitExpiryDate = data.creditLimitExpiryDate - accruedInterest = data.accruedInterest - accountHolderNames = data.accountHolderNames - startDate = data.startDate - minimumRequiredBalance = data.minimumRequiredBalance - accountHolderAddressLine1 = data.accountHolderAddressLine1 - accountHolderAddressLine2 = data.accountHolderAddressLine2 - accountHolderStreetName = data.accountHolderStreetName - town = data.town - postCode = data.postCode - countrySubDivision = data.countrySubDivision - creditAccount = data.creditAccount - debitAccount = data.debitAccount - accountHolderCountry = data.accountHolderCountry - id = data.id - name = data.name - externalTransferAllowed = data.externalTransferAllowed - crossCurrencyAllowed = data.crossCurrencyAllowed - productKindName = data.productKindName - productTypeName = data.productTypeName - bankAlias = data.bankAlias - sourceId = data.sourceId - accountOpeningDate = data.accountOpeningDate - lastUpdateDate = data.lastUpdateDate - userPreferences = data.userPreferences?.mapToDomain() - state = data.state?.mapToDomain() - parentId = data.parentId - subArrangements = data.subArrangements?.mapToDomain() - financialInstitutionId = data.financialInstitutionId - lastSyncDate = data.lastSyncDate - additions = data.additions - displayName = data.displayName - cardDetails = data.cardDetails?.mapToDomain() - interestDetails = data.interestDetails?.mapToDomain() - reservedAmount = data.reservedAmount - remainingPeriodicTransfers = data.remainingPeriodicTransfers - nextClosingDate = data.nextClosingDate - overdueSince = data.overdueSince - externalAccountStatus = data.externalAccountStatus - } - } -} - -internal fun SavingsAccountsDataModel.mapToDomain(): SavingsAccounts { - val data = this@mapToDomain - return SavingsAccounts { - products = data.products.mapToDomain() - name = data.name - aggregatedBalance = data.aggregatedBalance?.mapToDomain() - additions = data.additions - } -} - -@Suppress("LongMethod") -@JvmName("SavingsAccountMapper") -internal fun List.mapToDomain(): List { - return this.map { data -> - SavingsAccount { - bookedBalance = data.bookedBalance - availableBalance = data.availableBalance - accruedInterest = data.accruedInterest - IBAN = data.IBAN - BBAN = data.BBAN - BIC = data.BIC - unMaskableAttributes = data.unmaskableAttributes?.mapToDomain() - currency = data.currency - urgentTransferAllowed = data.urgentTransferAllowed - bankBranchCode = data.bankBranchCode - bankBranchCode2 = null - accountInterestRate = data.accountInterestRate - minimumRequiredBalance = data.minimumRequiredBalance - startDate = data.startDate - termUnit = data.termUnit?.mapToDomain() - termNumber = data.termNumber - maturityDate = data.maturityDate - maturityAmount = data.maturityAmount - autoRenewalIndicator = data.autoRenewalIndicator - interestPaymentFrequencyUnit = data.interestPaymentFrequencyUnit?.mapToDomain() - interestPaymentFrequencyNumber = data.interestPaymentFrequencyNumber - principalAmount = data.principalAmount - interestSettlementAccount = data.interestSettlementAccount - accountHolderNames = data.accountHolderNames - valueDateBalance = data.valueDateBalance - accountHolderAddressLine1 = data.accountHolderAddressLine1 - accountHolderAddressLine2 = data.accountHolderAddressLine2 - accountHolderStreetName = data.accountHolderStreetName - town = data.town - postCode = data.postCode - countrySubDivision = data.countrySubDivision - accountHolderCountry = data.accountHolderCountry - creditAccount = data.creditAccount - debitAccount = data.debitAccount - id = data.id - name = data.name - externalTransferAllowed = data.externalTransferAllowed - crossCurrencyAllowed = data.crossCurrencyAllowed - productKindName = data.productKindName - productTypeName = data.productTypeName - bankAlias = data.bankAlias - sourceId = data.sourceId - accountOpeningDate = data.accountOpeningDate - lastUpdateDate = data.lastUpdateDate - userPreferences = data.userPreferences?.mapToDomain() - state = data.state?.mapToDomain() - parentId = data.parentId - subArrangements = data.subArrangements?.mapToDomain() - financialInstitutionId = data.financialInstitutionId - lastSyncDate = data.lastSyncDate - additions = data.additions - displayName = data.displayName - cardDetails = data.cardDetails?.mapToDomain() - interestDetails = data.interestDetails?.mapToDomain() - reservedAmount = data.reservedAmount - remainingPeriodicTransfers = data.remainingPeriodicTransfers - nextClosingDate = data.nextClosingDate - overdueSince = data.overdueSince - externalAccountStatus = data.externalAccountStatus - } - } -} - -internal fun TermDepositsDataModel.mapToDomain(): TermDeposits { - val data = this@mapToDomain - return TermDeposits { - products = data.products.mapToDomain() - name = data.name - aggregatedBalance = data.aggregatedBalance?.mapToDomain() - additions = data.additions - } -} - -@JvmName("TermDepositMapper") -internal fun List.mapToDomain(): List { - return this.map { data -> - TermDeposit { - bookedBalance = data.bookedBalance - principalAmount = data.principalAmount - accruedInterest = data.accruedInterest - IBAN = data.IBAN - BBAN = data.BBAN - currency = data.currency - urgentTransferAllowed = data.urgentTransferAllowed - productNumber = data.productNumber - accountInterestRate = data.accountInterestRate - startDate = data.startDate - termUnit = data.termUnit?.mapToDomain() - termNumber = data.termNumber - maturityDate = data.maturityDate - maturityAmount = data.maturityAmount - autoRenewalIndicator = data.autoRenewalIndicator - interestPaymentFrequencyUnit = data.interestPaymentFrequencyUnit?.mapToDomain() - interestPaymentFrequencyNumber = data.interestPaymentFrequencyNumber - interestSettlementAccount = data.interestSettlementAccount - valueDateBalance = data.valueDateBalance - accountHolderNames = data.accountHolderNames - outstandingPrincipalAmount = data.outstandingPrincipalAmount - creditAccount = data.creditAccount - debitAccount = data.debitAccount - minimumRequiredBalance = data.minimumRequiredBalance - id = data.id - name = data.name - externalTransferAllowed = data.externalTransferAllowed - crossCurrencyAllowed = data.crossCurrencyAllowed - productKindName = data.productKindName - productTypeName = data.productTypeName - bankAlias = data.bankAlias - sourceId = data.sourceId - accountOpeningDate = data.accountOpeningDate - lastUpdateDate = data.lastUpdateDate - userPreferences = data.userPreferences?.mapToDomain() - state = data.state?.mapToDomain() - parentId = data.parentId - subArrangements = data.subArrangements?.mapToDomain() - financialInstitutionId = data.financialInstitutionId - lastSyncDate = data.lastSyncDate - additions = data.additions - displayName = data.displayName - cardDetails = data.cardDetails?.mapToDomain() - interestDetails = data.interestDetails?.mapToDomain() - reservedAmount = data.reservedAmount - remainingPeriodicTransfers = data.remainingPeriodicTransfers - nextClosingDate = data.nextClosingDate - overdueSince = data.overdueSince - externalAccountStatus = data.externalAccountStatus - bankBranchCode2 = data.bankBranchCode2 - } - } -} - -internal fun LoansDataModel.mapToDomain(): Loans { - val data = this@mapToDomain - return Loans { - products = data.products.mapToDomain() - name = data.name - displayName = data.name - aggregatedBalance = data.aggregatedBalance?.mapToDomain() - additions = data.additions - } -} - -@JvmName("LoanMapper") -internal fun List.mapToDomain(): List { - return this.map { data -> - Loan { - bookedBalance = data.bookedBalance - principalAmount = data.principalAmount - currency = data.currency - urgentTransferAllowed = data.urgentTransferAllowed - productNumber = data.productNumber - accountInterestRate = data.accountInterestRate - termUnit = data.termUnit?.mapToDomain() - termNumber = data.termNumber - outstandingPrincipalAmount = data.outstandingPrincipalAmount - monthlyInstalmentAmount = data.monthlyInstalmentAmount - amountInArrear = data.amountInArrear - interestSettlementAccount = data.interestSettlementAccount - accruedInterest = data.accruedInterest - accountHolderNames = data.accountHolderNames - maturityDate = data.maturityDate - valueDateBalance = data.valueDateBalance - creditAccount = data.creditAccount - debitAccount = data.debitAccount - IBAN = data.IBAN - BBAN = data.BBAN - id = data.id - name = data.name - externalTransferAllowed = data.externalTransferAllowed - crossCurrencyAllowed = data.crossCurrencyAllowed - productKindName = data.productKindName - productTypeName = data.productTypeName - bankAlias = data.bankAlias - sourceId = data.sourceId - accountOpeningDate = data.accountOpeningDate - lastUpdateDate = data.lastUpdateDate - userPreferences = data.userPreferences?.mapToDomain() - state = data.state?.mapToDomain() - parentId = data.parentId - subArrangements = data.subArrangements?.mapToDomain() - financialInstitutionId = data.financialInstitutionId - lastSyncDate = data.lastSyncDate - additions = data.additions - displayName = data.displayName - cardDetails = data.cardDetails?.mapToDomain() - interestDetails = data.interestDetails?.mapToDomain() - reservedAmount = data.reservedAmount - remainingPeriodicTransfers = data.remainingPeriodicTransfers - nextClosingDate = data.nextClosingDate - overdueSince = data.overdueSince - externalAccountStatus = data.externalAccountStatus - bankBranchCode2 = data.bankBranchCode2 - } - } -} - -internal fun CreditCardsDataModel.mapToDomain(): CreditCards { - val data = this@mapToDomain - return CreditCards { - products = data.products.mapToDomain() - name = data.name - aggregatedBalance = data.aggregatedBalance?.mapToDomain() - additions = data.additions - } -} - -@JvmName("CreditCardMapper") -internal fun List.mapToDomain(): List { - return this.map { data -> - CreditCard { - bookedBalance = data.bookedBalance - availableBalance = data.availableBalance - creditLimit = data.creditLimit - number = data.number - currency = data.currency - bankBranchCode2 = null - urgentTransferAllowed = data.urgentTransferAllowed - cardNumber = data.cardNumber - creditCardAccountNumber = data.creditCardAccountNumber - validThru = data.validThru - applicableInterestRate = data.applicableInterestRate - remainingCredit = data.remainingCredit - outstandingPayment = data.outstandingPayment - minimumPayment = data.minimumPayment - minimumPaymentDueDate = data.minimumPaymentDueDate - accountInterestRate = data.accountInterestRate - accountHolderNames = data.accountHolderNames - creditLimitUsage = data.creditLimitUsage - creditLimitInterestRate = data.creditLimitInterestRate - accruedInterest = data.accruedInterest - id = data.id - name = data.name - externalTransferAllowed = data.externalTransferAllowed - crossCurrencyAllowed = data.crossCurrencyAllowed - productKindName = data.productKindName - productTypeName = data.productTypeName - bankAlias = data.bankAlias - sourceId = data.sourceId - accountOpeningDate = data.accountOpeningDate - lastUpdateDate = data.lastUpdateDate - userPreferences = data.userPreferences?.mapToDomain() - state = data.state?.mapToDomain() - parentId = data.parentId - subArrangements = data.subArrangements?.mapToDomain() - financialInstitutionId = data.financialInstitutionId - lastSyncDate = data.lastSyncDate - additions = data.additions - displayName = data.displayName - cardDetails = data.cardDetails?.mapToDomain() - interestDetails = data.interestDetails?.mapToDomain() - reservedAmount = data.reservedAmount - remainingPeriodicTransfers = data.remainingPeriodicTransfers - nextClosingDate = data.nextClosingDate - overdueSince = data.overdueSince - externalAccountStatus = data.externalAccountStatus - } - } -} - -internal fun DebitCardsDataModel.mapToDomain(): DebitCards { - val data = this@mapToDomain - return DebitCards { - products = data.products.mapToDomain() - name = data.name - aggregatedBalance = data.aggregatedBalance?.mapToDomain() - additions = data.additions - } -} - -@JvmName("DebitCardMapper") -internal fun List.mapToDomain(): List { - return this.map { data -> - DebitCard { - debitCardsItems = data.debitCardsItems.mapToDomain() - number = data.number - urgentTransferAllowed = data.urgentTransferAllowed - cardNumber = data.cardNumber - accountInterestRate = data.accountInterestRate - accountHolderNames = data.accountHolderNames - startDate = data.startDate - validThru = data.validThru - id = data.id - name = data.name - externalTransferAllowed = data.externalTransferAllowed - crossCurrencyAllowed = data.crossCurrencyAllowed - productKindName = data.productKindName - productTypeName = data.productTypeName - bankAlias = data.bankAlias - sourceId = data.sourceId - accountOpeningDate = data.accountOpeningDate - lastUpdateDate = data.lastUpdateDate - userPreferences = data.userPreferences?.mapToDomain() - state = data.state?.mapToDomain() - parentId = data.parentId - subArrangements = data.subArrangements?.mapToDomain() - financialInstitutionId = data.financialInstitutionId - lastSyncDate = data.lastSyncDate - additions = data.additions - displayName = data.displayName - cardDetails = data.cardDetails?.mapToDomain() - interestDetails = data.interestDetails?.mapToDomain() - reservedAmount = data.reservedAmount - remainingPeriodicTransfers = data.remainingPeriodicTransfers - nextClosingDate = data.nextClosingDate - overdueSince = data.overdueSince - externalAccountStatus = data.externalAccountStatus - } - } -} - -internal fun AggregatedBalanceDataModel.mapToDomain(): AggregatedBalance { - val data = this@mapToDomain - return AggregatedBalance { - value = data.value - currency = data.currency - additions = data.additions - } -} - -internal fun InvestmentAccountsDataModel.mapToDomain(): InvestmentAccounts { - val data = this@mapToDomain - return InvestmentAccounts { - products = data.products.mapToDomain() - name = data.name - aggregatedBalance = data.aggregatedBalance?.mapToDomain() - additions = data.additions - } -} - -@JvmName("InvestmentAccountMapper") -internal fun List.mapToDomain(): List { - return this.map { data -> - InvestmentAccount { - currentInvestmentValue = data.currentInvestmentValue - currency = data.currency - urgentTransferAllowed = data.urgentTransferAllowed - productNumber = data.productNumber - IBAN = data.IBAN - BBAN = data.BBAN - id = data.id - name = data.name - externalTransferAllowed = data.externalTransferAllowed - crossCurrencyAllowed = data.crossCurrencyAllowed - productKindName = data.productKindName - productTypeName = data.productTypeName - bankAlias = data.bankAlias - sourceId = data.sourceId - accountOpeningDate = data.accountOpeningDate - lastUpdateDate = data.lastUpdateDate - userPreferences = data.userPreferences?.mapToDomain() - state = data.state?.mapToDomain() - parentId = data.parentId - subArrangements = data.subArrangements?.mapToDomain() - financialInstitutionId = data.financialInstitutionId - lastSyncDate = data.lastSyncDate - additions = data.additions - displayName = data.displayName - cardDetails = data.cardDetails?.mapToDomain() - interestDetails = data.interestDetails?.mapToDomain() - reservedAmount = data.reservedAmount - remainingPeriodicTransfers = data.remainingPeriodicTransfers - nextClosingDate = data.nextClosingDate - overdueSince = data.overdueSince - externalAccountStatus = data.externalAccountStatus - } - } -} - -@JvmName("debitCardItemMapper") -internal fun Set.mapToDomain(): Set { - return this.map { data -> - DebitCardItem { - number = data.number - expiryDate = data.expiryDate - cardId = data.cardId - cardHolderName = data.cardholderName - cardType = data.cardType - cardStatus = data.cardStatus - additions = data.additions - } - }.toSet() -} - -internal fun Set.mapToDomain(): Set { - return this.map { data -> - when (data) { - com.backbase.android.client.gen2.arrangementclient2.model.MaskableAttribute.IBAN -> MaskableAttribute.IBAN - com.backbase.android.client.gen2.arrangementclient2.model.MaskableAttribute.BBAN -> MaskableAttribute.BBAN - com.backbase.android.client.gen2.arrangementclient2.model.MaskableAttribute.Number -> MaskableAttribute.Number - } - }.toSet() -} - -internal fun TimeUnitDataModel.mapToDomain(): TimeUnit { - return when (this) { - TimeUnitDataModel.D -> TimeUnit.Day - TimeUnitDataModel.W -> TimeUnit.Week - TimeUnitDataModel.M -> TimeUnit.Month - TimeUnitDataModel.Y -> TimeUnit.Year - } -} - -internal fun UserPreferencesDataModel.mapToDomain(): UserPreferences { - val data = this@mapToDomain - return UserPreferences { - alias = data.alias - visible = data.visible - favorite = data.favorite - additions = data.additions - } -} - -internal fun StateItemDataModel.mapToDomain(): ProductState { - val data = this@mapToDomain - return ProductState { - externalStateId = data.externalStateId - state = data.state - additions = data.additions - } -} - -internal fun List.mapToDomain(): List { - return this.mapNotNull { data -> - BaseProduct { - id = data.id - name = data.name - externalTransferAllowed = data.externalTransferAllowed - crossCurrencyAllowed = data.crossCurrencyAllowed - productKindName = data.productKindName - productTypeName = data.productTypeName - bankAlias = data.bankAlias - sourceId = data.sourceId - visible = data.visible - accountOpeningDate = data.accountOpeningDate - lastUpdateDate = data.lastUpdateDate - userPreferences = data.userPreferences?.mapToDomain() - state = data.state?.mapToDomain() - parentId = data.parentId - subArrangements = data.subArrangements?.mapToDomain() - financialInstitutionId = data.financialInstitutionId - lastSyncDate = data.lastSyncDate - additions = data.additions - cardDetails = data.cardDetails?.mapToDomain() - interestDetails = data.interestDetails?.mapToDomain() - reservedAmount = data.reservedAmount - remainingPeriodicTransfers = data.remainingPeriodicTransfers - nextClosingDate = data.nextClosingDate - overdueSince = data.overdueSince - externalAccountStatus = data.externalAccountStatus - bankBranchCode2 = data.bankBranchCode2 - } - } -} - -internal fun CardDetailsDataModel.mapToDomain(): CardDetails { - val data = this@mapToDomain - return CardDetails { - cardProvider = data.cardProvider - secured = data.secured - availableCashCredit = data.availableCashCredit - cashCreditLimit = data.cashCreditLimit - lastPaymentDate = data.lastPaymentDate - lastPaymentAmount = data.lastPaymentAmount - latePaymentFee = data.latePaymentFee - previousStatementDate = data.previousStatementDate - previousStatementBalance = data.previousStatementBalance - statementBalance = data.statementBalance - additions = data.additions - } -} - -internal fun InterestDetailsDataModel.mapToDomain(): InterestDetails { - val data = this@mapToDomain - return InterestDetails { - lastYearAccruedInterest = data.lastYearAccruedInterest - dividendWithheldYTD = data.dividendWithheldYTD - annualPercentageYield = data.annualPercentageYield - cashAdvanceInterestRate = data.cashAdvanceInterestRate - penaltyInterestRate = data.penaltyInterestRate - additions = data.additions - } -} diff --git a/app-common/build.gradle.kts b/app-common/build.gradle.kts index b1f355a8..9cfa109f 100644 --- a/app-common/build.gradle.kts +++ b/app-common/build.gradle.kts @@ -13,7 +13,6 @@ android { dependencies { implementation(platform(libs.kotlin.bom)) implementation(projects.accountsJourney) - implementation(projects.accountsUseCase) implementation(libs.bundles.navigation) coreLibraryDesugaring(libs.coreLibraryDesugaring) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c037f56d..1acbb878 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -92,7 +92,6 @@ android { dependencies { implementation(projects.appCommon) implementation(projects.accountsJourney) - implementation(projects.accountsUseCase) implementation(platform(backbase.bom)) diff --git a/app/src/main/kotlin/com/backbase/golden_sample_app/journey/accounts/AccountsModule.kt b/app/src/main/kotlin/com/backbase/golden_sample_app/journey/accounts/AccountsModule.kt index 43ef02db..0031e86d 100644 --- a/app/src/main/kotlin/com/backbase/golden_sample_app/journey/accounts/AccountsModule.kt +++ b/app/src/main/kotlin/com/backbase/golden_sample_app/journey/accounts/AccountsModule.kt @@ -3,8 +3,8 @@ package com.backbase.golden_sample_app.journey.accounts import android.app.Application import com.backbase.accounts_journey.AccountsJourney import com.backbase.accounts_journey.routing.AccountsRoutingImpl -import com.backbase.accounts_use_case.AccountDetailUseCaseImpl -import com.backbase.accounts_use_case.AccountSummaryUseCaseImpl +import com.backbase.accounts_journey.data.usecase.AccountDetailUseCaseImpl +import com.backbase.accounts_journey.data.usecase.AccountSummaryUseCaseImpl import com.backbase.android.client.gen2.arrangementclient2.api.ArrangementsApi import com.backbase.android.client.gen2.arrangementclient2.api.ProductSummaryApi import com.backbase.app_common.accounts.accountsModule diff --git a/settings.gradle.kts b/settings.gradle.kts index 59b56f58..1bebc61b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -36,7 +36,6 @@ rootProject.name = "Golden_Sample_App_Android" include(":app") include(":app-common") include(":accounts-journey") -include(":accounts-use-case") include(":accounts-test-data") include(":accounts-demo") include(":test-data")