distributeaid / toolbox

DistributeAid Toolbox
http://distributeaid.org
GNU Affero General Public License v3.0
3 stars 1 forks source link

Entries can have duplicates in lists #80

Closed pedro-gutierrez closed 3 years ago

pedro-gutierrez commented 3 years ago

Extra test that ensures we can add twice the same entry in a list. Eg. we allow to have an entry with 1 t-shirt of size Large, and another entry with 3 t-shirts of size Large as well. Checking uniqueness at the database level is too complex because we would need to do a uniqueness check across 3 tables (item, mods and entry mod values). Doing a check at the api level could be done, but it wouldn't be without potential race conditions. So for now, we allow this situation and we will see in the future if this introduces issues in our data. If that is the case, we can also implement apis to consolidate needs lists by detecting and fixing duplicates, or we can simply build a UI to let the user fix the needs list manually.

Fixes: #68