Msi 2030 add ability to mark orders placed with store pickup#2082
Conversation
Declare db schema.
Add new extension attribute.
Decrease schema dependency on inventory_source.
| use Magento\Framework\App\ResourceConnection; | ||
|
|
||
| /** | ||
| * Class GetPickupPointByOrderId. |
There was a problem hiding this comment.
Repeating class name in the comment is redundant. Clear responsibility description is sufficient.
| */ | ||
| class GetPickupPointByOrderId | ||
| { | ||
| const ORDER_ID = 'order_id'; |
There was a problem hiding this comment.
Should these constants be private?
| * | ||
| * @return string|null | ||
| */ | ||
| public function execute(int $orderId):?string |
There was a problem hiding this comment.
Why should pickup point id be a string? Maybe it's a point code?
| --> | ||
| <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> | ||
| <table name="inventory_pickup_point_order" resource="default" engine="innodb"> |
There was a problem hiding this comment.
We have to discuss Pickup Point naming. It's best to align it with business domain
There was a problem hiding this comment.
Changed to 'Pickup Location'.
| <module name="Magento_InventoryInStorePickup" setup_version="1.0.0"> | ||
| <sequence> | ||
| <module name="Magento_Sales" /> | ||
| <module name="Magento_Inventory" /> |
There was a problem hiding this comment.
Should it be Magento_Inventory or InventoryApi?
Also sales should be added to composer dependencies
There was a problem hiding this comment.
For now, dependency on Magento_Sales only.
Added to composer.json.
…ability-to-mark-orders-placed-with-store-pickup
Fix tests and apply code review corrections.
…ability-to-mark-orders-placed-with-store-pickup
Add integration test for order placement. MSI-2030-Add an ability to Mark Orders placed with Store Pickup.
744249d to
3548061
Compare
Pickup Point -> Pickup Location Pickup Point Id -> Pickup Location Code
Add join directive for extension attribute.
| /** @var AddressInterface $address */ | ||
| $address = $addressFactory->create( | ||
| [ | ||
| 'data' => [ |
There was a problem hiding this comment.
I love how you save a US address to the Quote in fixture designed for EU Website :)
…placed-with-store-pickup
|
Hi @swnsma, thank you for your contribution! |
Description (*)
Add possibility to mark orders, created with 'In Store Pickup' Shipping method.
Add extension attribute to order entity with information about related pickup point.
Fixed Issues
Points to discuss
Probably, it will be nice to add this extension attribute to collection join:
But for this we need to add join processor for Order Repository 'getList' method in Magento 2 Core Repository (https://github.com/magento-engcom/msi/blob/475dc7c32e54621087b9669ca76ab1eacecde12f/app/code/Magento/Sales/Model/OrderRepository.php#L197)
E.g.
UPD: issue already reported magento/magento2#8035
Contribution checklist (*)