Skip to content

fix(settings): render same-day settings for carriers (trunkrs) with same-day delivery type - #508

Open
FreekVR wants to merge 7 commits into
mainfrom
fix/INT-1561-same-day-delivery-type-settings
Open

fix(settings): render same-day settings for carriers (trunkrs) with same-day delivery type#508
FreekVR wants to merge 7 commits into
mainfrom
fix/INT-1561-same-day-delivery-type-settings

Conversation

@FreekVR

@FreekVR FreekVR commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

renders the same-day delivery settings for carriers that expose same-day as a delivery type instead of a shipment option.

Some carriers (like Trunkrs) advertise same-day delivery as a delivery type in their contract, while others (like DHL For You) advertise it as a shipment option. The carrier settings view only checked the shipment option, so for delivery-type carriers the cutoff time field never rendered and the same-day cutoff silently stayed at the 10:00 default. When same-day is all the carrier offers, that hides the carrier from checkout after the cutoff with no way to fix it in the admin. The same-day section now renders for both representations and is the single owner of these fields. This also removes a duplicate same-day toggle that was rendered for shipment-option carriers.

Fixes INT-1561

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 20, 2026 10:59
@FreekVR
FreekVR requested a review from a team as a code owner July 20, 2026 10:59
@github-project-automation github-project-automation Bot moved this to Todo in PDK Jul 20, 2026
@FreekVR FreekVR changed the title fix(settings): render same-day settings for carriers with same-day delivery type fix(settings): render same-day settings for carriers (trunkrs) with same-day delivery type Jul 20, 2026

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 updates the PDK carrier settings UI so the same-day delivery settings render for carriers that expose same-day as a delivery type (not only as a shipment option), and consolidates same-day settings into a single section to avoid duplicates.

Changes:

  • Render the same-day settings section when SAME_DAY is present in carrier.deliveryTypes, not only when the sameDayDelivery shipment option is supported.
  • Prevent duplicate same-day toggles by skipping SAME_DAY in both the dynamic delivery-type list and the shipment-options list.
  • Extend unit test coverage and update JSON snapshots to reflect the new settings structure.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Frontend/View/CarrierSettingsItemView.php Adds SAME_DAY-delivery-type detection for rendering the same-day section; skips SAME_DAY in other sections to avoid duplicates.
tests/Unit/Frontend/View/CarrierSettingsItemViewTest.php Adds coverage for same-day-as-delivery-type and asserts same-day settings render exactly once across representations.
tests/snapshots/SettingsViewTest__it_gets_settings_view_with_data_set_carrier_settings__1.json Snapshot updates reflecting removal of duplicate same-day elements and updated ordering.
tests/snapshots/FrontendRenderServiceTest__it_renders_component_with_data_set_plugin_settings__1.json Snapshot updates reflecting removal of duplicate same-day elements and updated ordering.

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

Comment thread src/Frontend/View/CarrierSettingsItemView.php Outdated
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.28571% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.31%. Comparing base (0a13274) to head (dc7b575).

Files with missing lines Patch % Lines
.../Carrier/Service/CapabilitiesValidationService.php 75.00% 1 Missing ⚠️
...tings/Repository/AbstractPdkSettingsRepository.php 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #508      +/-   ##
============================================
- Coverage     94.33%   94.31%   -0.02%     
- Complexity     2414     2422       +8     
============================================
  Files           352      352              
  Lines          7726     7745      +19     
============================================
+ Hits           7288     7305      +17     
- Misses          438      440       +2     

☔ 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.

Comment thread src/Frontend/View/CarrierSettingsItemView.php
@myparcel-bot myparcel-bot Bot added the approved (Auto) label Jul 21, 2026
@FreekVR
FreekVR force-pushed the fix/INT-1561-same-day-delivery-type-settings branch from 8090ca2 to 2680ea3 Compare July 21, 2026 12:41
@FreekVR
FreekVR requested a review from Copilot July 21, 2026 12:59

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread src/App/Order/Calculator/General/CustomerInformationCalculator.php
Comment thread src/App/Order/Calculator/General/CustomerInformationCalculator.php
@myparcel-bot
myparcel-bot Bot force-pushed the fix/INT-1561-same-day-delivery-type-settings branch 6 times, most recently from abfcabf to 21a01f2 Compare August 6, 2026 14:18
@myparcel-bot
myparcel-bot Bot force-pushed the fix/INT-1561-same-day-delivery-type-settings branch from 21a01f2 to 132fa0f Compare August 7, 2026 08:39
NabDevs and others added 6 commits August 7, 2026 14:34
* Guard carrier settings

* test: clean carrier guard

* fix: validate carrier entries

* fix: ignore malformed carrier settings

* refactor: simplify carrier settings guard
…livery type

Carriers that expose same-day as a delivery type (e.g. Trunkrs) instead of
a shipment option (e.g. DHL For You) were missing the same-day section in
the carrier settings view, so the same-day cutoff time could not be
configured. The section now renders for both representations and is the
single owner of these fields, which also removes the duplicate same-day
toggle that was rendered for shipment-option carriers.

Fixes INT-1561

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…quires it

Moving same-day into its own settings section skipped the read-only
guard for carriers that mark same-day as required in their
capabilities. Apply makeReadOnlyWhenRequired in the same-day section
too, and split the representation checks into two named booleans for
readability.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fixes an issue where same day delivery was blocked for any date in the future if the current hour was past the configured "cutoff time sameDay" or if the "drop off delay" was more than 0

the delivery options widget decides which dates are available for same day
delivery now

remember: same day delivery means shipment and delivery happen on the same day, not if the customer can expect their shipment on the same day as ordering. Whether thats possible is decided by a combination of "cut off time" and "drop off days".

"drop off delay" only indicates how long it takes to process an order: it doesnt mean that the merchant can't drop off their shipment on the same day it will be delivered if that delivery is planned ex. 2 days in the future (past the drop off delay). the merchant can still opt-out of same day delivery but simply not enabling the delivery type - and it's off by default.

reverts the changes from #356
@myparcel-bot
myparcel-bot Bot force-pushed the fix/INT-1561-same-day-delivery-type-settings branch from 601cb71 to dc7b575 Compare August 7, 2026 14:34
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