Skip to content

Conversation

@NabDevs
Copy link
Contributor

@NabDevs NabDevs commented Oct 31, 2025

Summary:
• Add Proposition class with constants (new terminology alongside legacy Platform)
• Add deprecated annotations to Platform class and facade
• Add proposition property to context models alongside existing platform property for backwards compatibility
• All existing functionality remains unchanged - this is a non-breaking terminology refactor

Changes:
• NEW: src/Account/Proposition.php - New constants class
• MODIFIED: src/Account/Platform.php - Added deprecated annotation
• MODIFIED: src/Facade/Platform.php - Added deprecated annotation pointing to PropositionService
• MODIFIED: src/Context/Model/GlobalContext.php - Added proposition property (array)
• MODIFIED: src/Context/Model/DeliveryOptionsConfig.php - Added proposition property (string)
• MODIFIED: tests/Unit/App/Context/Model/DeliveryOptionsConfigTest.php - Updated assertions
• MODIFIED: 3 snapshot files - Added proposition property
• DELETED: 2 old PropositionManager snapshot files (cleanup)

Notes:
• Uses existing PropositionService for all logic (no duplication)
• Platform constants and facade remain fully functional for backwards compatibility

INT-1085

@NabDevs NabDevs requested a review from a team as a code owner October 31, 2025 12:49
Copilot AI review requested due to automatic review settings October 31, 2025 12:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a new "Proposition" concept to replace the legacy "Platform" terminology throughout the codebase, while maintaining full backward compatibility. The change adds a new PropositionManager and Proposition facade as the preferred API, while keeping the Platform facade functional but deprecated.

Key changes:

  • New Proposition API: Added PropositionManager, PropositionManagerInterface, Proposition facade, and Proposition class with constants
  • Backward compatibility layer: Platform API remains functional via delegation, with deprecation notices added
  • Context model updates: GlobalContext and DeliveryOptionsConfig now contain both proposition (new) and platform (legacy) properties with identical data
  • Comprehensive test coverage: New test files ensure parity between old and new APIs

Reviewed Changes

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

Show a summary per file
File Description
src/Proposition/PropositionManager.php New manager implementing proposition-specific logic with runtime platform detection
src/Proposition/PropositionManagerInterface.php Interface defining proposition operations (all, get, getPropositionName, getCarriers)
src/Facade/Proposition.php New facade providing clean API for proposition operations
src/Account/Proposition.php New constants class for proposition IDs and names
src/Platform/PlatformManager.php Added deprecated getPropositionName() method delegating to getPlatform()
src/Facade/Platform.php Added deprecation notice to docblock
src/Context/Model/GlobalContext.php Added proposition property alongside platform for dual support
src/Context/Model/DeliveryOptionsConfig.php Added proposition property alongside platform for dual support
config/pdk-services.php Registered PropositionManagerInterface service binding
tests/Unit/Proposition/PropositionManagerTest.php Comprehensive test suite with parity tests
tests/Unit/Context/PropositionContextTest.php Tests for context models with dual property support
tests/snapshots/*.json Updated snapshots reflecting new proposition properties

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

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.91%. Comparing base (616c759) to head (570f3af).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #398   +/-   ##
=========================================
  Coverage     94.91%   94.91%           
  Complexity     2032     2032           
=========================================
  Files           359      359           
  Lines          6642     6645    +3     
=========================================
+ Hits           6304     6307    +3     
  Misses          338      338           

☔ View full report in Codecov by Sentry.
📢 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.

@NabDevs NabDevs force-pushed the feature/refactor-platform-naming-to-proposition branch from 4dc4a99 to 1aea3be Compare November 4, 2025 10:13
@myparcel-bot myparcel-bot bot added the changes requested (Auto) label Nov 4, 2025
@FreekVR FreekVR changed the base branch from main to v3-proposition November 18, 2025 11:18
Base automatically changed from v3-proposition to main January 19, 2026 12:44
@NabDevs NabDevs force-pushed the feature/refactor-platform-naming-to-proposition branch 2 times, most recently from 995569f to f079211 Compare January 20, 2026 15:04
- Add Proposition class with new constants
- Add @deprecated annotations to Platform class and facade
- Add proposition property to GlobalContext and DeliveryOptionsConfig
- Update snapshots and tests for new proposition property

Co-Authored-By: Warp <[email protected]>
@NabDevs NabDevs force-pushed the feature/refactor-platform-naming-to-proposition branch from f079211 to 570f3af Compare January 20, 2026 15:18
@myparcel-bot myparcel-bot bot added approved (Auto) and removed changes requested (Auto) labels Jan 20, 2026

declare(strict_types=1);

namespace MyParcelNL\Pdk\Account;
Copy link
Contributor

Choose a reason for hiding this comment

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

Right now, there's nothing under the "Account" namespace in the API for propositions, and likely won't be for some time. The Proposition service for now would be standalone, so I'd suggest putting it under a Proposition namespace?

])
);

$this->attributes['proposition'] = $filteredData;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest not mapping proposition to platform config here, there's no point in passing them both otherwise. (so platform is the proposition mapped to a legacy format, proposition is the new proposition config)

'packageType' => 'package',
'pickupLocationsDefaultView' => $pickupLocationsDefaultView,
'allowPickupLocationsViewSelection' => $allowPickupLocationsViewSelection,
'proposition' => Platform::LEGACY_MYPARCEL_NAME,
Copy link
Contributor

Choose a reason for hiding this comment

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

Proposition should use the new CONSTANT_CASE names, not the legacy ones

@myparcel-bot myparcel-bot bot added changes requested (Auto) and removed approved (Auto) labels Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

5 participants