Skip to content

Conversation

@jaclync
Copy link
Contributor

@jaclync jaclync commented Sep 26, 2025

Final PR for WOOMOB-935

~273 files are moved without diffs. Project file diffs are ~1600 (mostly deletions).

Description

This pull request introduces the new PointOfSale module to the Swift package, migrating various Point of Sale (POS) related source files and analytics logic from the WooCommerce directory into the new module. It also makes necessary APIs public, updates the package manifest to include the new targets and dependencies, and adds related test targets and Xcode scheme configuration.

New Module Integration and Package Manifest Updates:

  • Added the PointOfSale library and target to Modules/Package.swift, specifying its dependencies and resources. Also added a corresponding test target PointOfSaleTests for POS-related unit tests. [1] [2] [3]
  • Updated the Xcode support configuration and added a new shared Xcode scheme for the PointOfSale module to enable building, running, profiling, and testing in Xcode. [1] [2]
  • Updated Package.resolved to reflect the new origin hash after modifying dependencies and targets.

Source File Migration and API Visibility:

  • Migrated POS-related source files from WooCommerce/Classes/POS/ to Modules/Sources/PointOfSale/, making several types and initializers public to support usage outside the module (e.g., POSOrderListFetchAnalytics, CardPresentPaymentCardReader, CardPresentPaymentOnboardingPresentationEvent, CardPresentPaymentReaderConnectionResult, CardPresentPaymentsRetryApproach). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Analytics Code Changes:

  • Refactored analytics event logic for POS, including making enums and methods public, adding a utility for consistent payment method analytics values, and updating event property assignments for improved clarity and extensibility. [1] [2] [3] [4]

Resource Management:

  • Ensured POS and related modules process their Resources directory for asset management, including POS specific colors and images. [1] [2] [3]
  • 🗒️ Ref p1759370243861079/1758875866.843589-slack-C025A8VV728: After the move of the color catalog asset to the POS module, the color symbols (generated through the ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS build setting) are not generated during the build process for unit tests. Therefore, this PR updates the POS colors to refer to the color catalog by their corresponding string name. There's a follow-up task to look more into reverting it back to the dot syntax color symbols.

Steps to reproduce

No behavior changes are expected from the POS modularization. Please perform a regression testing on POS and IPP, where some code/assets are shared.

Testing information

I did a round of regression testing on iPad Pro 11in 3rd generation, iOS 26.0, from the installable build.


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

staskus and others added 30 commits September 17, 2025 18:19
# Conflicts:
#	Modules/Sources/PointOfSale/Presentation/PointOfSaleEntryPointView.swift
…eworks' into feat/woomob-935-fix-build-errors

# Conflicts:
#	WooCommerce/WooCommerce.xcodeproj/project.pbxproj
…for-passing-font-from-pos-module' into feat/woomob-935-fix-build-errors
…t it can be moved to WooFoundation. `AppStartupWaitingTimeTracker` is now a wrapper of `WaitingTimeTracker`.
…mob-935-fix-build-errors

# Conflicts:
#	Modules/Sources/PointOfSale/Presentation/Reusable Views/POSListEmptyView.swift
#	Modules/Sources/PointOfSale/Protocols/POSDependencyProviding.swift
#	Modules/Sources/PointOfSale/Utils/PreviewHelpers.swift
#	WooCommerce/Classes/POS/Presentation/PointOfSaleEntryPointView.swift
#	WooCommerce/WooCommerce.xcodeproj/project.pbxproj
# Conflicts:
#	Modules/Sources/PointOfSale/Analytics/POSOrderListFetchAnalytics.swift
#	Modules/Sources/PointOfSale/Presentation/Orders/POSDetailsView.swift
#	Modules/Sources/PointOfSale/Presentation/Orders/POSOrderDetailsView.swift
#	Modules/Tests/PointOfSaleTests/Mocks/MockAnalytics.swift
#	WooCommerce/Classes/POS/Presentation/Orders/POSDetailsView.swift
#	WooCommerce/WooCommerce.xcodeproj/project.pbxproj
#	WooCommerce/WooCommerceTests/POS/Mocks/MockAnalytics.swift
#	WooCommerce/WooCommerceTests/POS/Mocks/MockPOSAnalytics.swift
…fix-build-errors

# Conflicts:
#	Modules/Sources/PointOfSale/Presentation/ItemListView.swift
#	Modules/Sources/PointOfSale/Utils/DynamicHStack.swift
#	Modules/Sources/PointOfSale/Utils/DynamicVStack.swift
#	Modules/Sources/PointOfSale/Utils/PreviewHelpers.swift
#	WooCommerce/WooCommerce.xcodeproj/project.pbxproj
#	WooCommerce/WooCommerceTests/POS/Mocks/MockPointOfSaleAggregateModel.swift
# Conflicts:
#	Modules/Sources/PointOfSale/Presentation/Orders/POSOrderBadgeView.swift
#	Modules/Sources/PointOfSale/Presentation/PointOfSaleAssets.swift
#	WooCommerce/WooCommerce.xcodeproj/project.pbxproj
… to see how it works on CI."

This reverts commit e2a619f.
@jaclync jaclync changed the title [WIP] [Woo POS] Modularization: working build & unit testing [Woo POS] Modularization: final move to POS module Oct 3, 2025
@jaclync jaclync marked this pull request as ready for review October 3, 2025 01:39
@jaclync jaclync added feature: POS and removed status: do not merge Dependent on another PR, ready for review but not ready for merge. labels Oct 3, 2025
@jaclync jaclync modified the milestones: 23.4, 23.5 Oct 3, 2025
@jaclync jaclync requested a review from staskus October 3, 2025 02:32
@jaclync
Copy link
Contributor Author

jaclync commented Oct 3, 2025

@iamgabrielma @joshheald 👋 We plan to land the POS modularization to trunk early next week, the beginning of the release 23.5 cycle. After this PR is merged, let's keep most of the POS code in the POS module, except for business logic in Yosemite and code that depends on the main app.

POS code under WooCommerce/Classes/POS/ from pre-existing branchs should be automatically moved to the POS module with the same folder hierarchy. In case of merge conflicts, POS file diffs in the WooCommerce project file can be deleted. Feel free to ping me/Povilas if you're uncertain about anything or see any issues from the PR as well.

Copy link
Contributor

@staskus staskus left a comment

Choose a reason for hiding this comment

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

🥇 Works great!

I performed a regression test, and fixed one issue where POS barcode scanning failure sound wasn't played. The audio wasn't loaded from the module bundle.

I merged with trunk, fixed 3 more warnings, and included a short section documenting the module.

Thank you very much for all this amazing work!

@staskus staskus merged commit 0dfc430 into trunk Oct 6, 2025
13 checks passed
@staskus staskus deleted the feat/woomob-935-fix-build-errors branch October 6, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants