diff --git a/server/AyaNova/biz/PartAssemblyBiz.cs b/server/AyaNova/biz/PartAssemblyBiz.cs index c067dc08..5089dace 100644 --- a/server/AyaNova/biz/PartAssemblyBiz.cs +++ b/server/AyaNova/biz/PartAssemblyBiz.cs @@ -272,6 +272,12 @@ namespace AyaNova.Biz } } + //no duplicate parts + //this would be caused by an API user not our UI so no need to translation + if (proposedObj.Items.GroupBy(z => z.PartId).Any(g => g.Count() > 1)) + { + AddError(ApiErrorCode.VALIDATION_FAILED, "Items", "Duplicate parts are not allowed in the items collection"); + } //Any form customizations to validate? var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.PartAssembly.ToString());