Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Products] Extract subscriptions outside of the Product DB table - Part 2 #12767

Merged
merged 4 commits into from
Oct 16, 2024

Conversation

hichamboushaba
Copy link
Member

@hichamboushaba hichamboushaba commented Oct 9, 2024

Closes: #12752

Description

This PR builds on top of what was added in #12766, it adds the saving logic, it updates both addProduct and updateProduct functions to handle passing the changed subscription details too.

Steps to reproduce

  1. Open the app.
  2. Navigate to the Products tab.
  3. For some scenarios: open an existing subscription product
  4. For other scenarios: create a new subscription product

Testing information

  • Confirm that saving changes of an existing product works as expected.
  • Confirm that creating a new subscription product works.
  • Confirm that duplicating a subscription product duplicates all subscription details.

The tests that have been performed

^

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

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:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@hichamboushaba hichamboushaba added type: technical debt Represents or solves tech debt of the project. feature: product details Related to adding or editing products, includes product settings. status: do not merge Dependent on another PR, ready for review but not ready for merge. labels Oct 9, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Oct 9, 2024

1 Warning
⚠️ This PR is assigned to the milestone 20.8. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 9, 2024

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commitf7e6c34
Direct Downloadwoocommerce-wear-prototype-build-pr12767-f7e6c34.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 9, 2024

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

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitf7e6c34
Direct Downloadwoocommerce-prototype-build-pr12767-f7e6c34.apk

@hichamboushaba hichamboushaba force-pushed the issue/12752-subscriptions-meta-2 branch from 035628d to feabdfb Compare October 10, 2024 09:33
@hichamboushaba hichamboushaba marked this pull request as ready for review October 10, 2024 09:37
@hichamboushaba hichamboushaba force-pushed the issue/12752-subscriptions-meta-2 branch from feabdfb to f7e6c34 Compare October 10, 2024 10:15
@JorgeMucientes JorgeMucientes self-assigned this Oct 15, 2024
Copy link
Contributor

@JorgeMucientes JorgeMucientes left a comment

Choose a reason for hiding this comment

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

Good job! I tested adding and updating subscription products and everything worked as expected. Also code changes look good. 🏅

Base automatically changed from issue/12752-subscriptions-meta-1 to trunk October 16, 2024 10:41
@hichamboushaba hichamboushaba removed the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Oct 16, 2024
@hichamboushaba hichamboushaba added this to the 20.8 milestone Oct 16, 2024
@hichamboushaba hichamboushaba merged commit daca67d into trunk Oct 16, 2024
16 of 17 checks passed
@hichamboushaba hichamboushaba deleted the issue/12752-subscriptions-meta-2 branch October 16, 2024 10:50
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 46.80851% with 25 lines in your changes missing coverage. Please review.

Project coverage is 40.87%. Comparing base (d5c3475) to head (f7e6c34).
Report is 142 commits behind head on trunk.

Files with missing lines Patch % Lines
...m/woocommerce/android/model/SubscriptionDetails.kt 0.00% 11 Missing ⚠️
...roid/ui/products/details/ProductDetailViewModel.kt 56.52% 6 Missing and 4 partials ⚠️
...oocommerce/android/ui/products/DuplicateProduct.kt 81.81% 1 Missing and 1 partial ⚠️
...oid/ui/products/details/ProductDetailRepository.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #12767      +/-   ##
============================================
- Coverage     40.88%   40.87%   -0.01%     
- Complexity     5771     5773       +2     
============================================
  Files          1237     1237              
  Lines         69745    69762      +17     
  Branches       9673     9680       +7     
============================================
+ Hits          28513    28518       +5     
- Misses        38604    38617      +13     
+ Partials       2628     2627       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: product details Related to adding or editing products, includes product settings. type: technical debt Represents or solves tech debt of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Custom Fields] Store changes cont: remove subscriptions data from WCProductModel
5 participants