Skip to content

fix: respect insure from setting - #515

Merged
joerivanveen merged 1 commit into
mainfrom
fix/respect-insure-from-setting
Aug 6, 2026
Merged

fix: respect insure from setting#515
joerivanveen merged 1 commit into
mainfrom
fix/respect-insure-from-setting

Conversation

@joerivanveen

Copy link
Copy Markdown
Contributor

INT-1781

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.31%. Comparing base (393ad70) to head (be3db73).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #515   +/-   ##
=========================================
  Coverage     94.31%   94.31%           
- Complexity     2419     2420    +1     
=========================================
  Files           352      352           
  Lines          7738     7738           
=========================================
  Hits           7298     7298           
  Misses          440      440           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joerivanveen
joerivanveen marked this pull request as ready for review August 4, 2026 11:06
@joerivanveen
joerivanveen requested a review from a team as a code owner August 4, 2026 11:06
Copilot AI lite review requested due to automatic review settings August 4, 2026 11:06

Copilot AI left a comment

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.

Pull request overview

This PR fixes insurance calculation so that when shipment option insurance is resolved to tri-state ENABLED (1) by the settings-resolution step, InsuranceCalculator derives the insured amount from carrier settings (including the “insure from” threshold) instead of mistakenly treating 1 as a literal insured amount.

Changes:

  • Update InsuranceCalculator to treat INHERIT (-1) and ENABLED (1) as “derive from carrier settings”.
  • Add/extend unit coverage to run TriStateOptionCalculator + InsuranceCalculator together for realistic export behavior.
  • Update the delivery options endpoint unit test expectation to match the corrected insurance derivation logic.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/Unit/App/Order/Calculator/General/InsuranceCalculatorTest.php Adds integration-style cases that include TriStateOptionCalculator, ensuring “insure from” and “insure up to” settings are applied in the real calculator order.
tests/Unit/App/Endpoint/GetDeliveryOptionsEndpointTest.php Updates expected insurance amount in micro-units to reflect deriving from carrier settings (and applying the exportInsuranceUpTo cap).
src/App/Order/Calculator/General/InsuranceCalculator.php Fixes interpretation of insurance=1 so it triggers settings-based derivation rather than tier resolution of a 1-cent “explicit amount”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-project-automation github-project-automation Bot moved this from Todo to Testing in PDK Aug 4, 2026
@myparcel-bot myparcel-bot Bot added the approved (Auto) label Aug 4, 2026
@myparcel-bot
myparcel-bot Bot force-pushed the fix/respect-insure-from-setting branch 5 times, most recently from 51e8989 to c59107f Compare August 6, 2026 11:18
@myparcel-bot
myparcel-bot Bot force-pushed the fix/respect-insure-from-setting branch from c59107f to be3db73 Compare August 6, 2026 14:18
@joerivanveen
joerivanveen added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit d3bde62 Aug 6, 2026
13 checks passed
@joerivanveen
joerivanveen deleted the fix/respect-insure-from-setting branch August 6, 2026 15:36
@github-project-automation github-project-automation Bot moved this from Testing to Done in PDK Aug 6, 2026
NabDevs pushed a commit that referenced this pull request Aug 7, 2026
myparcel-bot Bot added a commit that referenced this pull request Aug 7, 2026
## [4.7.1](v4.7.0...v4.7.1) (2026-08-07)

### 🐛 Bug Fixes

* respect insure from setting ([#515](#515)) ([a611219](a611219))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved (Auto)

Development

Successfully merging this pull request may close these issues.

4 participants