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

Export product data to DFC via the DFC Connector #10781

Closed
Tracked by #10289
mkllnk opened this issue May 2, 2023 · 1 comment · Fixed by #10488
Closed
Tracked by #10289

Export product data to DFC via the DFC Connector #10781

mkllnk opened this issue May 2, 2023 · 1 comment · Fixed by #10488
Assignees

Comments

@mkllnk
Copy link
Member

mkllnk commented May 2, 2023

ℹ️ This is a funded feature. Please use the Clockify project with the following name when working on this, including review and test: #9170 OFN DFC Products

Description

Subtask of:

- As a: enterprise user
- On page: Visiting a DFC compliant platform like the DFC Prototype.
- I want to be able to do: Import OFN data.

Acceptance Criteria & Tests

  1. The following fields should be exported:
    • OFN:producer
    • OFN:sku
    • OFN:product name
    • OFN:display.name
    • OFN:category - moved to new issue Match product taxons to DFC product types #10809
    • OFN:description
    • OFN:units
    • OFN:unit.type
    • OFN:variant.unit.name - note this will likely be limited to 'items' by the DFC protocol
    • OFN:price
    • OFN:on.hand
    • OFN:available.on
    • OFN:on.demand
    • OFN:shipping.category
    • OFN:tax.category - note there are outstanding questions here

EDIT
The work on the connector itself should be tracked separately in 10828 DFC Ruby Connector.

@mkllnk
Copy link
Member Author

mkllnk commented May 5, 2023

Category

We need to find a way to match OFN product categories (Spree::Taxon) with DFC ProductType. The OFN side is different on every instance and depends on the local language.

For example in Australia we have:

Spree::Taxon.pluck(:name)
=> 
["Wood",
 "Household",
 "Fungi",
 "Gifts",
 "Sweets & Treats",
 "Prepared Meals",
 "Boxes",
 "Vegetables",
 "Oils & Spreads",
 "Fodder",
 "Herbs & Spices",
 "Pickles & Preserves",
 "Meat & Fish",
 "Fibre",
 "Personal Care",
 "Fruit",
 "Specials",
 "Bulk Buy",
 "Plants & Garden",
 "Dairy",
 "Drinks",
 "Poultry & Eggs",
 "Pulses & Grains",
 "Nuts & Dried Fruits",
 "Bakery",
 "Products"]

And in France:

Spree::Taxon.distinct.pluck(:name)
=> 
["ALCOOL FORT",
 "LÉGUMINEUSES",
 "AUTRES",
 "PRODUITS POUR BÉBÉ",
 "VIN ROSE",
 "CHAMPAGNE",
 "CHARCUTERIES",
 "BIERE",
 "VIN ROUGE",
 "COSMÉTIQUES",
 "PROMOTIONS",
 "HERBES & ÉPICES",
 "PRODUIT",
 "PRODUITS MÉNAGERS",
 "PAINS, FARINES, CÉRÉALES",
 "CIDRE",
 "PRODUITS ARTISANAUX",
 "POISSON",
 "PLATS PRÉPARÉS",
 "PORC",
 "FRUITS",
 "FRUITS SECS & NOIX",
 "THÉS, CAFÉS",
 "VIANDE",
 "BIERE BLANCHE",
 "ŒUFS",
 "BOEUF",
 "SERVICES",
 "PRODUITS LAITIERS",
 "PRODUITS SUCRÉS",
 "FLEURS",
 "Pants et Graines",
 "CHOCOLAT ET CACAO",
 "VEAU",
 "LÉGUMES",
 "RIZ, PÂTES & CO",
 "TRAITEUR",
 "GIBIERS",
 "AUTRES ALCOOLS",
 "AGNEAU",
 "PANIERS",
 "BOISSONS, JUS",
 "Miel et produits de la ruche",
 "BIERE AMBRÉE",
 "BIERE BLONDE",
 "CONSERVES & BOCAUX",
 "HUILES & VINAIGRES",
 "VIN BLANC",
 "FRUITS & LÉGUMES",
 "VOLAILLES"]

Solution ideas

  1. We could try to match by name. This would currently fail in most cases. We can rename categories in OFN to match the DFC name but the DFC standard currently contains only English and French. Other languages would, at least currently, not work.
  2. We could add a new field to Spree::Taxon to link to the DFC category. Once instance managers copied the links to DFC categories into OFN then it can be used in the DFC export and import.
  3. We could replace all current OFN categories with DFC categories. Instead of instance managers maintaining the categories, we could load the DFC database. We would need to contribute to the DFC to add all languages we support or use Transifex to translate the category names (or both). Instances then need to change the DFC standard if they want to change the categories.

I think that the last option would be the best long-term but it also requires a mapping of current categories to DFC categories for the migration. So solution 2 could be a good intermediate step to achieve the mapping and see if we can map everything to the DFC.

None of this would be ready for the demo in June. So we could create a short hard-coded mapping of some categories just for the data used in the demo. I will post this in Slack to discuss as well.

I created a new issue for this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants