-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Msi 2030 add ability to mark orders placed with store pickup #2082
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pickup Point
term has to be discussed and aligned with business domain- Please add integration tests as well
- Please update with the latest changes from
store-pickup
branch
use Magento\Framework\App\ResourceConnection; | ||
|
||
/** | ||
* Class GetPickupPointByOrderId. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repeating class name in the comment is redundant. Clear responsibility description is sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
*/ | ||
class GetPickupPointByOrderId | ||
{ | ||
const ORDER_ID = 'order_id'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these constants be private
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* | ||
* @return string|null | ||
*/ | ||
public function execute(int $orderId):?string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should pickup point id be a string
? Maybe it's a point code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
--> | ||
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to discuss Pickup Point
naming. It's best to align it with business domain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be Magento_Inventory
or InventoryApi
?
Also sales
should be added to composer dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 (*)