-
Notifications
You must be signed in to change notification settings - Fork 4
Architectural alignment #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -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 { | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I recommend this change to enforce the SAM nature of this use-case and name it accordingly. |
||||||
| suspend fun getAccountDetail(params: Params): Result<AccountDetail> | ||||||
| suspend fun getAccountDetail(params: Params): Result<AccountArrangementItem> | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am still not convinced about exposing client objects directly with the journey's APIs. We risk unnecessarily coupling the client API with journey's API. Clients are generated and inherently produce unstable(especially from past experience) API that strongly tied to the BE. I am not sure it's prudent to strongly couple the 2. Also keep in mind that for certain BE capabilities, their models don't map 1-to-1 to UI models . BE models will still need some mapping/transformation in the journey in some cases. |
||||||
|
|
||||||
| @Poko | ||||||
| class Params private constructor(val id: String) { | ||||||
|
|
||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same recommendations as |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -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<AccountSummary> | ||||||
| suspend fun getAccountSummary(useCache: Boolean = true): Result<ProductSummary> | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has potential precision and unchecked nullability issues. Better to use
BigDecimal("45.89")to be exact.