Allow additional data to be passed to product adaptors #657
Replies: 2 comments 1 reply
-
It's not out of the question, but the problem is, product adapter is called from within the Where are those extra parts of the SKU coming from? |
Beta Was this translation helpful? Give feedback.
-
Hi Matt In my case, I cannot reliably parse a sku to determine its constituent parts, those being style + colour code + size. Unfortunately the client does not have a set schema, e.g. first 5 are the style, next 4 are the colour and anything after that is the size. The data is all over the place. The bulk of the product information is coming from their erp (navision) and we import into Ravendb. We import the data from several different sql tables and create a single document per product for searching and aggregation. For the product data we only need the style, but to retrieve the price and stock (and discounts), we need the full sku. As I said above, from a given sku there is no reliable way to break it apart. Currently I have to separate them with a space, e.g. PR123 BLK 16/17 so I can pull all the product data from raven and then remove the spaces and look up price and stock with the full sku. 2 suggestions
Just a suggestion as what I'm doing is a bit hacky, but works. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Not a problem perse but I do have to pass the product reference a specific way so the adapter can handle the request. Not ideal and very error prone.
Describe the solution you'd like
Have an overload for .GetProduct() that takes, for example an IDictionary<string,string>(), that can contain additional information for a custom adapter to retrieve product data.
Describe alternatives you've considered
Before we call .GetProduct() we have to build a new string with the portions of the sku separated by a space. In the adapter, it can then use those separated values to retrieve all the data from the various data stores.
Additional context
Product adaptors are fairly limited given all you get is the product reference to work with. In my situation all product data is split between 2 or 3 locations. Some information is from one location (database) and other data, i.e. price and stock are coming from another location (erp export). To get the product data we need only a portion of the product reference (sku) but unfortunately the client does not have a defined structure for their skus. In the adapter we don't have a way to determine the parts of the sku so we have to pass in the parts separated by a space.
Beta Was this translation helpful? Give feedback.
All reactions