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

feat: #350 - new method getProductFreshness #351

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

monsieurtanuki
Copy link
Contributor

New file:

  • ProductFreshness.dart: Freshness of a [Product].

Impacted files:

  • api_searchProduct_test.dart: new test about "product freshness"
  • openfoodfacts.dart: new method getProductFreshness

New file:
* `ProductFreshness.dart`: Freshness of a [Product].

Impacted files:
* `api_searchProduct_test.dart`: new test about "product freshness"
* `openfoodfacts.dart`: new method `getProductFreshness`
@teolemon
Copy link
Member

Can we reserve the freshness namespace for this ?
openfoodfacts/openfoodfacts-server#5674
Score readiness or something instead ?

@monsieurtanuki
Copy link
Contributor Author

I'm not against changing the name.

My point was to create a class (ProductFreshness) where we could put several different freshness or readiness fields.
Currently:

  • bool isEcoscoreReady
  • bool isNutriscoreReady
  • bool isIngredientsReady

And maybe later

  • Etag
  • int lastModified

The goal being to provide a method that helps to quickly monitor the state of a product: how complete it is, and how fresh the data is.
But that's perhaps a bit redundant with the "states".
ProductCompletionState?

@teolemon
Copy link
Member

teolemon commented Jan 1, 2022

@monsieurtanuki
Copy link
Contributor Author

Happy New Year!
@teolemon You're right, that sounds a bit like ProductImprovement.
We'd be better off merging that in a single class:

  • bool isEcoscoreReady
  • bool isNutriscoreReady
  • bool isIngredientsReady
  • Etag
  • int lastModified
  • bool ORIGINS_TO_BE_COMPLETED
  • bool CATEGORIES_BUT_NO_NUTRISCORE
  • bool ADD_NUTRITION_FACTS
  • bool ADD_CATEGORY
  • bool ADD_NUTRITION_FACTS_AND_CATEGORY
  • bool OBSOLETE_NUTRITION_IMAGE

Does that make sense?

@teolemon
Copy link
Member

teolemon commented Jan 5, 2022

it does

…ements" to freshness

Impacted files:
* `api_searchProducts_test.dart`: added test about `lastModified`
* `openfoodfacts.dart`: added "last modified" and "states tags" to the query
* `ProductFreshness.dart`: added `lastModified` and `ProductImprovement`s
@monsieurtanuki
Copy link
Contributor Author

@teolemon ping

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

Successfully merging this pull request may close these issues.

2 participants