wordpress-mobile / WordPress-FluxC-Android

WordPress Network and Persistence layer based on the Flux architecture
GNU General Public License v2.0
57 stars 37 forks source link

Woo/meta data refactor 3 #3074

Closed hichamboushaba closed 3 months ago

hichamboushaba commented 3 months ago

First of all, sorry for the size of the PR, fixing the tests caused more changes than I anticipated, and it's not easy to split this work further.

This PR adds the third part of the metadata refactor for Woo parts, the main change of the PR is to handle saving the product's metadata in the separate table MetaData, and this happens at every product persist call.

This required some other changes:

I'll add additional comments below for places where I consider it necessary for understanding.

Testing

hichamboushaba commented 3 months ago

Thanks for the review @JorgeMucientes 🙏

While testing, I noticed that the meta data that is not directly tied to the subscription product metadata, is missing. If I open View custom fields from order details, I can only see is_vat_exmpt field. However, my product contains several other custom fields that are missing and are not displayed. Is that expected at this point and I missed something?

Currently, we don't offer any screen to show the metadata linked to a given product, the "View custom fields" button in the app lists only the metadata linked to the given order, so what you faced is expected. With the project we are working on now, we'll add the screen to list the product metadata as well with the ability to edit it.

JorgeMucientes commented 3 months ago

Hey @hichamboushaba

Currently, we don't offer any screen to show the metadata linked to a given product, the "View custom fields" button in the app lists only the metadata linked to the given order, so what you faced is expected.

I see. I mixed up adding custom fields to products and to orders. I thought that an order that contained products with custom fields would reflect the custom fields for the product (not only for the order itself). Thanks for clarifying!

Good to go :shipit: