msenyk / nodejs-tech-task2024

Тестове завдання для зимової практики Salesforce 2024
GNU General Public License v3.0
0 stars 1 forks source link

I an administrator I should not be able to include the same ingredient into recipe twice #6

Open msenyk opened 9 months ago

msenyk commented 9 months ago

The system should prevent of adding the same ingredient into recipe more than 1 time. For example, if I need to add 100 grams of tomato I must do it with single record. If I create first record for 50 grams of tomato I won't be able to add second record with 50 grams.

msenyk commented 9 months ago

You correctly check if we are adding the same ingredient to the recipe. But the validation also prevents editing the existing recipe items. Steps to reproduce:

  1. Open any existing recipe
  2. Add new recipe items e.g. "Помідор черрі" 1 piece
  3. Try to edit quantity of just added recipe item - you will get an error "this ingradient already exists".
theclaaud commented 9 months ago

fixed, removed trigger on edit