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

Add capacity to know which fields are producer provided #727

Closed
teolemon opened this issue Apr 21, 2023 · 2 comments
Closed

Add capacity to know which fields are producer provided #727

teolemon opened this issue Apr 21, 2023 · 2 comments

Comments

@teolemon
Copy link
Member

Why - Problem description

  • We're going to enforce better protection of data when we get reliable data from producers.
  • As a result, regular contributors are going to try and edit products, and their contributions won't be saved.
  • This has the potential to be a frustrating/confusing experience, so we should prevent it from happening.

What - Proposed solution

@monsieurtanuki
Copy link
Contributor

I've just managed to change the product name in French on the prod website for 7613035982116 (and rolled back, of course).
As far as I understand the JSON that name was provided by the manufacturer, right?
But the protection of producer data is not implemented yet on the server side, right?

What are we supposed to store in off-dart? For each field (possibly with language):

  1. a bool stating that it was set by the producer?
  2. a timestamp (or null) of the latest update by the producer?
  3. the sorted lists of timestamps
  4. a timestamp + the id of the producer for the latest update?
  5. the sorted lists of timestamps + producers?
{
	"code": "7613035982116",
	"product": {
		"sources": [{
			"fields": [
				"product_name_fr",
				"abbreviated_product_name_fr",
				"generic_name_fr",
				"brands",
				"labels",
				"producer_version_id",
				"conservation_conditions_fr",
				"nutriscore_grade_producer",
				"customer_service_fr",
				"preparation_fr",
				"data_sources",
				"serving_size",
				"ingredients_text_fr"
			],
			"id": "org-nestle-france",
			"images": [],
			"import_t": 1679119300,
			"manufacturer": 1,
			"name": "nestle-france",
			"url": null
		}, {
			"fields": [],
			"id": "org-nestle-france",
			"images": [],
			"import_t": 1680150654,
			"manufacturer": 1,
			"name": "nestle-france",
			"url": null
		}, {
			"fields": [],
			"id": "org-nestle-france",
			"images": [],
			"import_t": 1680669259,
			"manufacturer": 1,
			"name": "nestle-france",
			"url": null
		}]
	},
	"status": 1,
	"status_verbose": "product found"
}

@monsieurtanuki
Copy link
Contributor

Duplicate with #956, I think.

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

No branches or pull requests

2 participants