Skip to content
This repository was archived by the owner on Oct 10, 2023. It is now read-only.

Conversation

@ggmaleva
Copy link
Contributor

@ggmaleva ggmaleva commented Aug 4, 2023

No description provided.

@ggmaleva ggmaleva requested a review from a team as a code owner August 4, 2023 10:19
event_occured_at timestamp without time zone NOT NULL,
sequence_id bigint NOT NULL,
adjustment_id character varying NOT NULL,
new_domain_revision bigint,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

вот сюда обратить внимание. в зависимости от корректировки сохраняю либо новую ревизию домена, либо статус. мб что-то еще нужно?

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Тут не очень понял вопрос. Это поле и есть смысл записи в БД. Это один из вариантов корректировки выплаты. Либо изменение статуса, либо домена. Собственно в эти поля (new_withdrawal_status и new_domain_revision) я и пишу результат.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Для платежей не меняется сама сущность платежа. Там табличка используется только чтоб данными заполнить сущность.

https://github.com/valitydev/newway/blob/epic/db_schema_optimization/src/main/java/dev/vality/newway/handler/event/stock/impl/invoicing/adjustment/InvoicePaymentAdjustmentCreatedHandler.java#L75

new PathConditionFilter(new PathConditionRule("change.adjustment.payload.status_changed.status", new IsNullCondition().not()));

@Override
@Transactional(propagation = Propagation.REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

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

вопрос со звездойчкой) для чего нам в рамках таких методов транзакции? Какую проблему мы ими закрываем?

Copy link
Contributor Author

@ggmaleva ggmaleva Aug 8, 2023

Choose a reason for hiding this comment

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

вопрос со звездойчкой) для чего нам в рамках таких методов транзакции? Какую проблему мы ими закрываем?

Хороший вопрос, коллега. Мы решаем проблему сознательности копипасты. Содержимое я поправил, а про аннотации забыл. Тут по сути оно не нужно. Нет сложной работы с БД. Тем более выше есть транзакция.

event_occured_at timestamp without time zone NOT NULL,
sequence_id bigint NOT NULL,
adjustment_id character varying NOT NULL,
new_domain_revision bigint,
Copy link
Contributor

Choose a reason for hiding this comment

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

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

external_id character varying,
current boolean DEFAULT true NOT NULL,
CONSTRAINT withdrawal_adjustment_pkey PRIMARY KEY (id),
CONSTRAINT withdrawal_adjustment_uniq UNIQUE (adjustment_id, sequence_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

@ggmaleva а там нет никакого эвента с old cash flow и new cash flow?

Copy link
Contributor Author

@ggmaleva ggmaleva Aug 8, 2023

Choose a reason for hiding this comment

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

@ggmaleva а там нет никакого эвента с old cash flow и new cash flow?

Да, есть. Причем, в обоих случаях - и при смене статуса и при смене ревизии. По ним тоже инфу надо сохранить?

Copy link
Contributor

Choose a reason for hiding this comment

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

Да, там как раз нужные суммы изменений для финансистов. Тут можно глянуть, как это сделано для платежей, правда не уверен, что можно использовать как есть.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Да, там как раз нужные суммы изменений для финансистов. Тут можно глянуть, как это сделано для платежей, правда не уверен, что можно использовать как есть.

ок, покопаюсь и добавлю

Copy link
Contributor Author

Choose a reason for hiding this comment

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

В итоге сделал подобно deposit с сохранением всех проводок.
https://github.com/valitydev/newway/tree/epic/db_schema_optimization/src/main/java/dev/vality/newway/handler/event/stock/impl/deposit/adjustment

@ggmaleva ggmaleva merged commit 76d1b4d into epic/db_schema_optimization Aug 18, 2023
@ggmaleva ggmaleva deleted the ft/TD-668 branch August 18, 2023 07:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants