ABN-298: Extended net terms and surcharge configuration#79
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive surcharge and payment terms system for the Two payment gateway, featuring an admin configuration grid, a calculation service, and a frontend term selector. It also modernizes the local development environment with Docker, Xdebug, and FRP proxy support, supported by new unit and E2E tests. Feedback focuses on improving code maintainability by refactoring duplicated logic in the order service and moving inline styles to external CSS files or standard Magento admin classes.
97044f4 to
f8b395c
Compare
e316346 to
4405245
Compare
f911874 to
369b21e
Compare
There was a problem hiding this comment.
All previously flagged issues are resolved:
- selectedTerm validation (critical):
getSelectedTermDays()now validates againstgetAllBuyerTerms()and falls back to the default term. Fix matches the suggestion exactly. - Inline styles: moved to
_surcharge-grid.less(auto-loaded via_module.less). - buildTermObject() duplication: extracted into shared helper.
No new critical issues found in the updated commits. Ready for human approval.
fe6fbb7 to
fb5236c
Compare
There was a problem hiding this comment.
Both previously flagged critical issues are resolved:
selectedTermvalidation (Service/Order/ComposeOrder.php):getSelectedTermDays()now validates the buyer-supplied value againstgetAllBuyerTerms()before use. ✓afterSave()not persisting values (Model/Config/Backend/SurchargeGrid.php): now reads fromgetData('groups')instead ofgetValue()(whichbeforeSave()had cleared). ✓
No new critical issues found in the updated commits. Ready for human approval.
fe6fbb7 to
11974fc
Compare
There was a problem hiding this comment.
Both issues flagged in my previous review are confirmed fixed:
selectedTermvalidation —getSelectedTermDays()now validates againstgetAllBuyerTerms()before trusting the buyer-supplied value; invalid/unconfigured terms fall back to the configured default.SurchargeGrid::afterSave()data source bug — now reads grid values fromgetData('groups')instead ofgetValue()(whichbeforeSave()clears to''), so surcharge config is actually persisted.
No new critical issues found in the updated diff. Ready for human review.
4b47f33 to
c1e27a6
Compare
…oling Extended net terms with configurable surcharge strategy (fixed, percentage, or both). Per-term surcharge grid with differential mode. Dev tooling: FRP proxy, Xdebug, debug mode, proxy auto-start in install target. Fixes: surcharge field visibility on "Use System Value" toggle, field value reset on inherit re-check, proxy base_link_url in patch-proxy section 3, broken validation rule blocking admin config save. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22a5d9e to
40ddf19
Compare
Summary
Based on #80 (dev tooling).
buyer_fee_share.reference_termsKey design decisions
frontend_modelBlock replacing 12 sequential fields/v1/pricing/order/feeAPI (single call), applies fixed amount and limit cap locallyCommit structure
Test plan
make test— 109 tests)make test-e2e)🤖 Generated with Claude Code