Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Jul 9, 2025

Part of WOOMOB-754

Description

To prepare for the update of the order details screen to show shipments, this PR adds a new type for WooShipping shipments and change the type of shipments in the config fetched from the remote.

The reasoning behind this change is that the shipments need to be saved to the local storage with a site ID and order ID for a better UX on the order details screen. The current dictionary cannot be persisted the same way.

The new WooShippingShipment type also comes with an optional shippingLabel property mapped from the data in the config response. The logic for managing shipping labels in the purchase flow has been simplified accordingly.

In subsequent PRs, I'll add a new Core Data entity for the shipments and support syncing shipments from the order details form.

Testing steps

  • Log in to a test store with Woo Shipping set up.
  • Navigate to the Orders tab and select an order with shipping labels created.
  • Confirm that shipping labels are still displayed on the order details as before.
  • Select Create shipping labels. Confirm that the shipments are displayed correctly with and without purchased labels.
  • Edit the shipments and confirm that all functionalities work as before.
  • Request a refund for a purchased label and confirm that the shipment is displayed in the unfulfilled state after requesting completes.

Testing information

  • Tested and confirmed with simulator iPhone 16 iOS 18.4.
  • Updated unit tests for the config mapper and splitting shipments.

Screenshots

No UI changes.


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@itsmeichigo itsmeichigo added this to the 22.8 milestone Jul 9, 2025
@itsmeichigo itsmeichigo added type: task An internally driven task. feature: shipping labels Related to creating, ordering, or printing shipping labels. labels Jul 9, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jul 9, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr15885-cc35a03
Version22.7
Bundle IDcom.automattic.alpha.woocommerce
Commitcc35a03
Installation URL16t4ndvl8ho6o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@itsmeichigo itsmeichigo marked this pull request as ready for review July 9, 2025 07:02
@itsmeichigo itsmeichigo requested a review from RafaelKayumov July 9, 2025 07:03
@itsmeichigo
Copy link
Contributor Author

Converting the PR back to draft for a better solution.

@itsmeichigo itsmeichigo marked this pull request as draft July 10, 2025 04:48
@itsmeichigo itsmeichigo removed the request for review from RafaelKayumov July 10, 2025 05:29
@itsmeichigo itsmeichigo changed the title Shipping Labels: Return shipments when syncing labels in order details Shipping Labels: Add new Networking type for WooShipping shipments Jul 10, 2025
@itsmeichigo itsmeichigo modified the milestones: 22.8, 22.9 Jul 10, 2025
@itsmeichigo itsmeichigo marked this pull request as ready for review July 10, 2025 09:18
Copy link
Contributor

@RafaelKayumov RafaelKayumov left a comment

Choose a reason for hiding this comment

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

LGTM. Works as described. Left couple questions.

currency: currency)
shipmentContents.append(content)
let purchasedLabel: ShippingLabel? = {
guard let label = shipment.shippingLabel, label.refund == nil else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also check for status here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RafaelKayumov - status is already checked when populating labels in the shipments when decoding the config response. Could you share why it's necessary here?

public let orderID: Int64

/// Index of the shipment
public let index: String
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add a comment clarifying the index format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in cc35a03.

Copy link
Contributor

@RafaelKayumov RafaelKayumov left a comment

Choose a reason for hiding this comment

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

Thx for the updates :shipit:

@itsmeichigo itsmeichigo merged commit 5358b2b into trunk Jul 11, 2025
13 checks passed
@itsmeichigo itsmeichigo deleted the woomob-754-shipping-labels-update-shipping-label-section-in-order branch July 11, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: shipping labels Related to creating, ordering, or printing shipping labels. type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants