woocommerce / woocommerce-ios

WooCommerce iOS app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
314 stars 113 forks source link

[Woo POS] Extract order creation to aggregate model #14437

Closed joshheald closed 3 days ago

joshheald commented 1 week ago

Closes: #14417

Description

Sorry this is so big... I really couldn't find a way to reduce the size without also breaking the app in the process...

This PR moves order creation/syncing, and the associated OrderState, to the new aggregate model.

I've also avoided exposing the order; all we need to actually show from it is the totals, so those are included in the order state now.

Tests mostly work, but there are some which aren't practical in the TotalsViewModelTests at the moment. Inline notes in the comments, and as I move more state into the aggregate model I'll be able to reinstate them (as tests on the aggregate model)

Testing information

This requires smoke testing of the order creation process, and some of the payments actions.

Screenshots

https://github.com/user-attachments/assets/1c1550b5-e0b4-4db9-ad1a-60d927d93d51


Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

dangermattic commented 1 week ago
1 Warning
:warning: This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by :no_entry_sign: Danger

wpmobilebot commented 1 week ago

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

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14437-333e8b1
Version21.1
Bundle IDcom.automattic.alpha.woocommerce
Commit333e8b1170ad36e67944a5a6f1cc41efaa939ca2
App Center BuildWooCommerce - Prototype Builds #11631

Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

iamgabrielma commented 4 days ago

👋 I started the code review but haven't had time to test any flow, if nobody beats me to it I can continue tomorrow.