-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MetaData support for Products, Orders and other resources #5897
Comments
I don't have strong opinions here, this seems like a legit feature. Still, the advantage of having this built-in vs implementing it custom when needed is not obvious. If someone needs a custom field in a resource, they could add one migration + Am I missing something and it's more complex than this? |
== updated twice == I think it's an extremely strong yet simple feature to have this onboard. Most companies just need an identifier (eg PO-Number) and having such field available easily seems low hanging fruit to me compared to Shopify or BigCommerce leveraging the ability to customize beyond what's possible with SAAS. Especially because it can be made agnostic to preexistent code, it's an addition without removing or complicating anything. |
@solidusio/core-team thoughts on this? |
I think it could be a useful feature. Using the Rails' data store makes much sense here. We would need to add a minimal UI for it, though, right? Any ideas? |
@tvdeyen don't we have something similar for the preferences UI? |
Ok, I take a look at it today. It seems to be really low hanging fruit. I would kick out the free text field and go with anything that works with limited length and covers also tokenized links (eg shipping labels, downloads,...). I would limit the whole thing to:
If you have particular use cases for text I am curios :) |
Should this be an augmentation of product properties, made more robust and extended to other models? |
I would go on different resources for different reasons:
It's very hard not to imagine added value with such an easy way to customize. |
Ok, if everybody is happy we would pick that up next week and see how to port Spree's meta data. @solidusio/core-team Is anybody particularily upset about anything spree has done in their own implementation? |
Thanks
I don't think there is a value for public vs. private meta data. For public product properties we can use the features we already have. Also, the linked git commit messages far from ideal. We prefer descriptive commit messages that explain why a change has been made and not a link to a private issue tracker. |
@tvdeyen theoretically it makes sense to separate in public and private: |
@tvdeyen I saw there's a lot going on on the backend, can you people integrate that into the work ongoing? I wouldn't like to touch something to throw away next week. |
As far as I understood the meta data is mainly for warehousing and accounting things, not meant to be public. For public meta data we have the Product Properties. We would like to keep it as simple as possible. |
I think one area of complexity/potential decisions needed is around REST API payload. Should these fields be part of the payload? |
Hmm I would handle it this way:
@tvdeyen Can you give an example? |
Hey guys, I would like to introduce you to @shahmayur001 who has worked on spree in the past for american customers mostly doing backend work. So to break it down: To be applied to: @tvdeyen I would love to give public and private a try and validate according to interface (storefront or pure API) the access. |
Do you have particular preferences on this point? |
I don't understand why we'd be storing this data as an array. I think we'd want to model this relationally. I don't care for Spree's approach for a bunch of reasons. |
Hey @jarednorman please be as specific as you can be. |
Regarding an array:
The great advantage is that any other system no matter what's already there can simply shoot in whatever value. Honestly I find that idea immensely sexy from a technical point of view and way cooler than everything I have seen regarding fields till today. It just needs to be limited and managed. |
Altneratively new table and split up the array and file together with resource id, would that work for you? It just blows up the requests for pretty much anything. Depending on scale I wouldn't suggest that on a large category page. |
@fthobe @jarednorman I think we are all on the same page, but using different words.
@fthobe do you mean that you are targeting those 8 resources listed that will have these metadata support? If I understood correctly, those metadata fields are going to be Related, JSONB is coming to Sqlite soon: https://sqlite.org/draft/jsonb.html |
Hey, Format: we can either use jsonb or alternatively hash the array, both is fine for me. Limitations: Where:
|
I am at RubyConf this week, so I don't really have the time to fully explain the implementation that I think we should go with, but I'm open to JSONB-backed implementation. I don't think the various limitations on storage are necessary. I will provide an in-depth explanation of one possible implementation path that I would be happy with next week. |
I hope rubyconf is fun. Ok on jsonb. Are there particular reasons not to limit the model? |
Hey @tvdeyen @jarednorman , before we PR anything, please find with this link an example for feedback, as soon as we have understood better how this works for you we can complete it and make a pull request. Please indicate if:
Some Notes
|
In addition a suggested PR comment and commit descriptions would be appreciated to get a hang of the whole thing. |
Introduction
Currently custom fields need to be hardcoded into the solution.
There are endless needs to customize orders, for example:
Spree found an elegant and easy to implement approach by creating a metadata storrage inside the primary objects.
Metadata on Spree Commerce
We would sponsor or merge this feature upon guidance from the core team.
Desired behavior
Custom values can be added to an order from front-end using a meta data field in major ressources.
The text was updated successfully, but these errors were encountered: