magento / architecture

A place where Magento architectural discussions happen
275 stars 153 forks source link

Customer order schema updates #382

Closed danielrenaud closed 4 years ago

danielrenaud commented 4 years ago

Problem

  1. SalesItemInterface is not being used properly as an interface
  2. Unclear how to return parent and child items in Orders/Invoices for bundle and configurable products
  3. Some shipment fields did not align with available data

Solution

  1. Remove SalesItemInterface and instead use unique types for each item type (OrderItem, InvoiceItem, etc) that have only relevant fields and an ID link to the associated order item
  2. For items that distinguish parent and child items (e.g. OrderItem and InvoiceItem) for complex products we introduce an item interface (e.g. OrderItemInterface) so that complex product types can add fields (e.g. BundleOrderItem)
  3. Remove ShipmentTracking.link; change ShipmentTracking.method to ShipmentTracking.title because available data does not align with shipping method

Other changes: Add comments field to Order and Invoice

Requested Reviewers

@joni-jones @akaplya @paliarush

YevSent commented 4 years ago

I would suggest adding CommentItem also for credit memo and shipment types.

danielrenaud commented 4 years ago

I would suggest adding CommentItem also for credit memo and shipment types.

For CreditMemo and Shipment, there is ability to add comment on backend but no option to make it visible on storefront. So seems like we shouldn't show it on storefront

EDIT: Nevermind; it depends on if you are creating or editing. So, we will add comments to those types.

danielrenaud commented 4 years ago

Made additional changes. Added comments to CreditMemo and OrderShipment types Change CustomerOrder.carrier, method, and shipping_address to be nullable because it is possible for these to be empty for an order (e.g. order with only virtual products)

DrewML commented 4 years ago

Do you have any screenshots of what the UI for this data looks like (or plans to look like)? We've got a backlog of schemas to review right now and would help us to make things speedier

danielrenaud commented 4 years ago

@DrewML In Luma if you login as a customer and go to "My Orders" (place some orders first), that is the UI that this is roughly based on.

DrewML commented 4 years ago

@DrewML In Luma if you login as a customer and go to "My Orders" (place some orders first), that is the UI that this is roughly based on.

Sure! I'm just asking that we include some screenshots since there will be more reviewers (few of us reviewing > 10 schemas in a rush atm). Lots of schemas covering tons of different areas, definitely easier if examples are readily accessible.

danielrenaud commented 4 years ago

Here is a collection of screenshots from the UI we are referencing for this schema.

Screen Shot 2020-06-02 at 2 47 59 PM Screen Shot 2020-06-02 at 2 48 13 PM Screen Shot 2020-06-02 at 2 48 22 PM Screen Shot 2020-06-02 at 2 48 31 PM Screen Shot 2020-06-02 at 2 48 41 PM

DrewML commented 4 years ago

Thanks @danielrenaud - that's super helpful!

danielrenaud commented 4 years ago

changed order_item_id: String to order_item: OrderItemInterface for InvoiceItem /CreditMemoItem / ShipmentItem

DrewML commented 4 years ago

We have approvals across the board on this, so I'm going to go ahead and merge.

@cpartica @danielrenaud if we're still iterating please feel free to open new PRs and we'll try to make it through them fast.