-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat(payments): Atlar connector: Add more bank details to Accounts (internal) and Payments #1607
feat(payments): Atlar connector: Add more bank details to Accounts (internal) and Payments #1607
Conversation
WalkthroughRecent updates to the Changes
Sequence Diagram(s)sequenceDiagram
participant TaskFetchAccounts
participant Client
participant ThirdPartiesService
participant AccountsService
TaskFetchAccounts->>Client: ingestAccountsBatch(taskID, client)
Client->>ThirdPartiesService: GetV1BetaThirdPartiesID(ctx, id)
ThirdPartiesService-->>Client: Third Party Data
Client->>AccountsService: GetV1AccountsID(ctx, id)
AccountsService-->>Client: Account Data
Client-->>TaskFetchAccounts: Processed Data
sequenceDiagram
participant TaskFetchTransactions
participant Client
participant TransactionsService
participant AccountsService
participant ThirdPartiesService
TaskFetchTransactions->>Client: ingestPaymentsBatch(ctx, connectorID, taskID, pagedTransactions)
Client->>TransactionsService: GetV1TransactionsID(ctx, id)
TransactionsService-->>Client: Transaction Data
Client->>AccountsService: ExtractPaymentMetadata(account, bank)
AccountsService-->>Client: Metadata
Client->>ThirdPartiesService: GetV1BetaThirdPartiesID(ctx, id)
ThirdPartiesService-->>Client: Third Party Data
Client-->>TaskFetchTransactions: Processed Payments
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (6)
components/payments/cmd/connectors/internal/connectors/atlar/task_fetch_accounts.go (1)
110-113
: Update function documentation.The function signature has changed to include
taskID
andclient
parameters. Ensure the function documentation is updated accordingly.components/payments/cmd/connectors/internal/connectors/atlar/task_payments.go (3)
Line range hint
1-235
:
Update function documentation.The function signature has changed to include
taskID
andclient
parameters. Ensure the function documentation is updated accordingly.
360-364
: Update function documentation.The function signature has changed to include
taskID
andclient
parameters. Ensure the function documentation is updated accordingly.
Line range hint
96-100
:
Update function documentation.The function signature has changed to include
taskID
andclient
parameters. Ensure the function documentation is updated accordingly.components/payments/cmd/connectors/internal/connectors/atlar/task_fetch_transactions.go (2)
69-71
: Update function documentation.The function signature has changed to include
taskID
andclient
parameters. Ensure the function documentation is updated accordingly.
96-100
: Update function documentation.The function signature has changed to include
taskID
andclient
parameters. Ensure the function documentation is updated accordingly.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- components/payments/cmd/connectors/internal/connectors/atlar/account_utils.go (1 hunks)
- components/payments/cmd/connectors/internal/connectors/atlar/client/accounts.go (1 hunks)
- components/payments/cmd/connectors/internal/connectors/atlar/client/third_parties.go (1 hunks)
- components/payments/cmd/connectors/internal/connectors/atlar/currencies.go (1 hunks)
- components/payments/cmd/connectors/internal/connectors/atlar/task_fetch_accounts.go (4 hunks)
- components/payments/cmd/connectors/internal/connectors/atlar/task_fetch_transactions.go (7 hunks)
- components/payments/cmd/connectors/internal/connectors/atlar/task_payments.go (2 hunks)
Additional comments not posted (19)
components/payments/cmd/connectors/internal/connectors/atlar/currencies.go (1)
8-8
: Addition of DKK currency looks good.The addition of "DKK" to the
supportedCurrenciesWithDecimal
map is correct and consistent with the existing structure.components/payments/cmd/connectors/internal/connectors/atlar/client/third_parties.go (1)
11-22
: New methodGetV1BetaThirdPartiesID
looks good.The method correctly handles context, uses deferred metrics, and constructs the parameters properly before making the API call.
components/payments/cmd/connectors/internal/connectors/atlar/client/accounts.go (1)
11-22
: New methodGetV1AccountsID
looks good.The method correctly handles context, uses deferred metrics, and constructs the parameters properly before making the API call.
components/payments/cmd/connectors/internal/connectors/atlar/account_utils.go (1)
48-52
: Modification ofExtractAccountMetadata
looks good.The function correctly uses the new
bank
parameter to extract additional metadata. The changes are consistent with the rest of the code.components/payments/cmd/connectors/internal/connectors/atlar/task_fetch_accounts.go (4)
Line range hint
1-109
:
LGTM!The function
FetchAccountsTask
has no changes and looks good.
115-120
: LGTM!The span attributes now include
taskID
, which is useful for tracing.
137-144
: Verify the timeout duration.The timeout duration for the context is set to 30 seconds. Ensure this duration is appropriate for the
GetV1BetaThirdPartiesID
call.
156-157
: LGTM!The
ExtractAccountMetadata
function now includes thethirdPartyResponse.Payload
parameter, which is correctly used.components/payments/cmd/connectors/internal/connectors/atlar/task_payments.go (6)
236-237
: LGTM!The
ingestAtlarTransaction
function call now includes thetaskID
parameter, which is correctly used.
365-367
: Verify the timeout duration.The timeout duration for the context is set to 30 seconds. Ensure this duration is appropriate for the
GetV1TransactionsID
call.
372-373
: LGTM!The
atlarTransactionToPaymentBatchElement
function call now includes thetaskID
parameter, which is correctly used.
Line range hint
133-140
:
Verify the timeout duration.The timeout duration for the context is set to 30 seconds. Ensure this duration is appropriate for the
GetV1AccountsID
call.
Line range hint
141-148
:
Verify the timeout duration.The timeout duration for the context is set to 30 seconds. Ensure this duration is appropriate for the
GetV1BetaThirdPartiesID
call.
Line range hint
169-170
:
LGTM!The
ExtractPaymentMetadata
function now includes theaccountResponse.Payload
andthirdPartyResponse.Payload
parameters, which are correctly used.components/payments/cmd/connectors/internal/connectors/atlar/task_fetch_transactions.go (5)
Line range hint
1-68
:
LGTM!The function
FetchTransactionsTask
has no changes and looks good.
77-78
: LGTM!The
atlarTransactionToPaymentBatchElement
function call now includes thetaskID
parameter, which is correctly used.
133-140
: Verify the timeout duration.The timeout duration for the context is set to 30 seconds. Ensure this duration is appropriate for the
GetV1AccountsID
call.
141-148
: Verify the timeout duration.The timeout duration for the context is set to 30 seconds. Ensure this duration is appropriate for the
GetV1BetaThirdPartiesID
call.
169-170
: LGTM!The
ExtractPaymentMetadata
function now includes theaccountResponse.Payload
andthirdPartyResponse.Payload
parameters, which are correctly used.
@@ -5,5 +5,6 @@ import "github.com/formancehq/payments/cmd/connectors/internal/connectors/curren | |||
var ( | |||
supportedCurrenciesWithDecimal = map[string]int{ | |||
"EUR": currency.ISO4217Currencies["EUR"], // Euro | |||
"DKK": currency.ISO4217Currencies["DKK"], |
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.
We need the DKK
currency, because there is only one bank for the EUR
currency in the Atlar default sandbox. After asking them for a second EUR
bank, they asked us if we could use a DKK
accounts for testing multi banking.
ctx, span := connectors.StartSpan( | ||
ctx, | ||
"atlar.atlarTransactionToPaymentBatchElement", | ||
attribute.String("connectorID", connectorID.String()), | ||
attribute.String("taskID", taskID.String()), | ||
) | ||
defer span.End() |
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.
I hope creating instead of passing a span is the correct thing to do here.
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.
Yep it's good, it's gonna be linked to the parent span thanks to the StartSpan function, so LGTM
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- components/payments/cmd/connectors/internal/connectors/atlar/task_payments.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- components/payments/cmd/connectors/internal/connectors/atlar/task_payments.go
…nternal) and Payments (#1607)
We're currently preparing for adding a second bank as partner to work with.
Going forward, we will need to differentiate payments and internal accounts by bank. This PR introduces the metadata necessary to do so.