Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Sep 17, 2025

Part of WOOMOB-1231

Description

This PR adds a new eligibility checker to determine if Bookings tab should be displayed for a store. The conditions include:

  • Should be hidden under a feature flag
  • Should only be enabled for CIAB users
  • We'll only show the tab if the CIAB user has at least one Bookable Product published. It the merchant is only selling "regular/physical" products, we won't display the Bookings tab.
  • Bookings tab will be shown right after products tab

The checker will be used in a subsequent PR for showing Bookings tab.

Testing steps

Since the checker is not used yet, just unit tests passing should be sufficient.

Testing information

Added unit tests for ProductStore, SessionManager, and BookingsTabEligibilityCheckerProtocol.

Screenshots

N/A


  • 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 23.3 milestone Sep 17, 2025
@itsmeichigo itsmeichigo added the type: task An internally driven task. label Sep 17, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Sep 17, 2025

1 Warning
⚠️ This PR is assigned to the milestone 23.3. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 17, 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 Numberpr16139-bd9d56d
Version23.2
Bundle IDcom.automattic.alpha.woocommerce
Commitbd9d56d
Installation URL25rkuthvg5oog
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 September 17, 2025 11:47
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. Just left a question.

if let status, (products.filter { $0.statusKey == status.rawValue }.isEmpty) == false {
return onCompletion(.success(true))
} else if status == nil {
} else if let productType, products.contains(where: { $0.productTypeKey == productType.rawValue}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Should we also update StorageType.loadProducts() and include product type into query instead of doing local filtering after a storage fetch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good thinking! I optimized the code in bd9d56d, let me know what you think @RafaelKayumov.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thx! :shipit:

@itsmeichigo itsmeichigo merged commit 5719ed7 into trunk Sep 18, 2025
14 checks passed
@itsmeichigo itsmeichigo deleted the woomob-1231-ios-bookings-tab branch September 18, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants