Skip to content

Add exchange rate#114

Merged
strug merged 2 commits into
masterfrom
ft/exchange-rate
Jul 9, 2026
Merged

Add exchange rate#114
strug merged 2 commits into
masterfrom
ft/exchange-rate

Conversation

@strug

@strug strug commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@strug
strug requested a review from a team as a code owner July 8, 2026 14:30
.map(paymentExchangeContext -> getDslContext().newRecord(
PAYMENT_EXCHANGE_CONTEXT, paymentExchangeContext))
.map(this::prepareInsertQuery)
.collect(Collectors.toList());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут можно сразу toList() использовать

List<PaymentWrapper> processableWrappers = wrappers.stream()
.filter(paymentWrapper -> Objects.nonNull(paymentWrapper.getPaymentExchangeContext()))
.collect(Collectors.toList());
List<PaymentExchangeContext> paymentExchangeContexts = processableWrappers.stream()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кажется, что можно без промежуточной переменной, в одном stream все это сделать, просто продолжить stream выше

.map(PaymentWrapper::getPaymentExchangeContext)
.toList()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кажется, что можно без промежуточной переменной, в одном stream все это сделать, просто продолжить stream выше

.map(PaymentWrapper::getPaymentExchangeContext)
.toList()

тоже так думал но когда поправил увидел что ниже они обе используются

InvoiceChange change = InvoiceChange.invoice_payment_change(new InvoicePaymentChange()
.setId("payment_id")
.setPayload(InvoicePaymentChangePayload.invoice_payment_exchange_context_changed(
new InvoicePaymentExchangeContextChanged(new ExchangeContext(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В двух тестах используешь создание этого объекта, можно вынести в какой-нибудь TestData. Да и в целом построение всех этих объектов можно унести в TestData. Тест читаться легче станет.

paymentId));
}

private PaymentWrapper buildPaymentExchangeContextWrapper(String invoiceId,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и это можно в TestData унести

@strug
strug merged commit 39caffb into master Jul 9, 2026
7 of 8 checks passed
@strug
strug deleted the ft/exchange-rate branch July 9, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants