Skip to content

Receipt Assistant: display an error when discounts are the same as full prices #2067

Description

@TTalex

What

  • API disallows prices created with same value between discounts and full price
  • However, AI detection sometimes does put the same values
  • This leads to price creation returning an (unhandled) error, and failing to create prices, without displaying any issue to the user.

Two things should be done:

  1. After calling the API, handle price creation errors, and display to users when only part of the prices were created, and why
  2. Before calling the API, consider discounted prices with same values as invalid, and show why. This should be handled the same way as a price missing, for example.

We could also automatically remove the discount flag and discounted price, but I'm not sure that it's clean. Usually the AI is right that the price was discounted, but failed to guess the value. So user input is required.

Example proof https://prices.openfoodfacts.org/experiments/receipt-assistant?proof_ids=92592

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for 🐛 Bug.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions