fix(order): include payment fee in draft order cost preview#450
Open
Ibochkarev wants to merge 1 commit into
Open
fix(order): include payment fee in draft order cost preview#450Ibochkarev wants to merge 1 commit into
Ibochkarev wants to merge 1 commit into
Conversation
Delegate OrdersController::recalculateOrderTotals to ManagerOrderCostRecalculator calculateBreakdown (MODE_AUTO) and persist via shared persistBreakdown so add/update product paths match recalculate-cost and finalize totals. Closes #449
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
При add/update/delete позиций в draft-заказе
OrdersController::recalculateOrderTotals()больше не считаетcost = cart + deliveryсpayment fee = 0. Метод делегирует вManagerOrderCostRecalculator::calculateBreakdown()(MODE_AUTO) и сохраняет breakdown через общийpersistBreakdown().Preview
costв черновике совпадает с «Пересчитать стоимость» и finalize для default handlers (cart + delivery + payment commission,free_delivery_amount, проценты доставки). Warnings логируются, но не блокируют CRUD позиций (в отличие от finalize).Зависимость: PR stacked на #448 (
fix/issue-373-finalize-order-cost); после merge #448 base можно переключить наbeta.Тип изменений
Связанные Issues
Closes #449
Relates to #373, #212
Как это было протестировано?
composer ci:php,npm run lint:ci/ GitHub Actions CI)Конфигурация тестирования:
Чеклист
npm run lint:ciдля Vue) — Vue не затронутДополнительные заметки
ManagerOrderCostRecalculator::persistBreakdown()— общий persist дляrecalculate()и preview path; добавлен guard на отсутствиеbreakdown,updatedonпри save.ManagerOrderCostRecalculatorRulesTest([Bug] OrderFinalizeService: payment fee=0 и нет free_delivery_amount #373); controller path — интеграционный smoke без xPDO stubs для OrdersController.