Skip to content

feat: 5553 - add prices for category products #6552

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Now when we add prices, we can add prices related to a category (e.g. "apples") instead of barcode

Screenshots

new "category input" button new "category input" page
Screenshot_1744719718 Screenshot_1744719743
new "price per" button category price input
Screenshot_1744719765 Screenshot_1744719770

Fixes bug(s)

Files

New files:

  • price_category_input_page.dart: Page that lets the user type in and select a single category for prices.
  • price_per_extension.dart: Extension for PricePer.

Impacted files:

  • app_en.arb: added 4 labels related to category and prices
  • app_fr.arb: added 4 labels related to category and prices
  • background_task_add_other_price.dart: added parameters related to category prices
  • background_task_add_price.dart: added parameters related to category prices
  • background_task_price.dart: added parameters related to category prices
  • price_add_product_card.dart: added an "add category product" button
  • price_amount_card.dart: added a DropDownButton for "price per" for category product
  • price_amount_model.dart: taken category prices into consideration
  • price_existing_amount_card.dart: unrelated localization
  • price_meta_product.dart: added a new meta product, related to category
  • price_model.dart: added parameters related to category prices
  • smooth_autocomplete_text_field.dart: added an "onSelected" optional parameter, in order to be able to select immediately a suggestion
  • smooth_dropdown.dart: added an "isExpanded" optional parameter, in order to match the screen width

New files:
* `price_category_input_page.dart`: Page that lets the user type in and select a single category for prices.
* `price_per_extension.dart`: Extension for PricePer.

Impacted files:
* `app_en.arb`: added 4 labels related to category and prices
* `app_fr.arb`: added 4 labels related to category and prices
* `background_task_add_other_price.dart`: added parameters related to category prices
* `background_task_add_price.dart`: added parameters related to category prices
* `background_task_price.dart`: added parameters related to category prices
* `price_add_product_card.dart`: added an "add category product" button
* `price_amount_card.dart`: added a DropDownButton for "price per" for category product
* `price_amount_model.dart`: taken category prices into consideration
* `price_existing_amount_card.dart`: unrelated localization
* `price_meta_product.dart`: added a new meta product, related to category
* `price_model.dart`: added parameters related to category prices
* `smooth_autocomplete_text_field.dart`: added an "onSelected" optional parameter, in order to be able to select immediately a suggestion
* `smooth_dropdown.dart`: added an "isExpanded" optional parameter, in order to match the screen width
Impacted files:
* `app_en.arb`: additional translations for "price per"
* `app_fr.arb`: additional translations for "price per"
* `price_existing_amount_field.dart`: localization
* `price_meta_product.dart`: minor refactoring
* `price_per_extension.dart`: additional translations for "price per"
@monsieurtanuki monsieurtanuki requested a review from teolemon April 15, 2025 12:47
@codecov-commenter
Copy link

codecov-commenter commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 1.05263% with 94 lines in your changes missing coverage. Please review.

Project coverage is 5.83%. Comparing base (4d9c7fc) to head (2664751).
Report is 837 commits behind head on develop.

Files with missing lines Patch % Lines
...pp/lib/pages/prices/price_category_input_page.dart 2.94% 33 Missing ⚠️
...h_app/lib/pages/prices/price_add_product_card.dart 0.00% 13 Missing ⚠️
...ooth_app/lib/background/background_task_price.dart 0.00% 11 Missing ⚠️
...smooth_app/lib/pages/prices/price_amount_card.dart 0.00% 11 Missing ⚠️
...mooth_app/lib/pages/prices/price_meta_product.dart 0.00% 6 Missing ⚠️
...ooth_app/lib/pages/prices/price_per_extension.dart 0.00% 6 Missing ⚠️
...ib/pages/input/smooth_autocomplete_text_field.dart 0.00% 5 Missing ⚠️
...kages/smooth_app/lib/pages/prices/price_model.dart 0.00% 4 Missing ⚠️
.../lib/pages/prices/price_existing_amount_field.dart 0.00% 2 Missing ⚠️
...mooth_app/lib/pages/prices/price_amount_model.dart 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #6552      +/-   ##
==========================================
- Coverage     9.54%   5.83%   -3.72%     
==========================================
  Files          325     501     +176     
  Lines        16411   29909   +13498     
==========================================
+ Hits          1567    1745     +178     
- Misses       14844   28164   +13320     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TTalex
Copy link
Collaborator

TTalex commented Apr 16, 2025

Very cool, some thoughts:

  • Maybe the "Enter a category" text can be replace with something like "Add a product without barcode" ? We have the same issue in prices web, the category term isn't clear for new users.
  • The API also supports fields like organic (is the product organic) and orgin (where is the product from). They aren't mandatory, but useful for data quality. Maybe something to add in a V2.
  • More of a taxonomy issue, but it would be nice to only suggest categories related to products without barcodes (fruits and vegetables)

@monsieurtanuki
Copy link
Contributor Author

Thank you @TTalex for your feedback!

Maybe the "Enter a category" text can be replace with something like "Add a product without barcode" ? We have the same issue in prices web, the category term isn't clear for new users.

I can do that.
Fun fact: yesterday I was in a French store (monoprix) and there were tourists trying to weight a melon on a machine. They couldn't find the "melon" button. I told the guy he won't manage to do that and he replied something like "but there's no barcode!". In that case the price was per unit. The concept of "no barcode" may indeed be relevant.

The API also supports fields like organic (is the product organic) and orgin (where is the product from). They aren't mandatory, but useful for data quality. Maybe something to add in a V2.

I'm not sure I'm going to do that right now, UX-wise.
I'm going to populate those extra fields, though, for internal reasons.

  • More of a taxonomy issue, but it would be nice to only suggest categories related to products without barcodes (fruits and vegetables)

I'm sure they sell "home-made muesli" so it wouldn't be a good idea to limit to fruits and vegetables.
As a matter of fact, my first addition was a fish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocomplete 🔁 Background tasks ✏️ Editing Many products are incomplete and don't have Nutri-Score, Eco-Score…so editing is important for users 🌐 l10n Prices
Projects
Status: Backlog
Status: 💬 To discuss and validate
Development

Successfully merging this pull request may close these issues.

Allow to add prices of products without barcode
3 participants