diff --git a/server/AyaNova/Controllers/FormFieldsDefinitionsController.cs b/server/AyaNova/Controllers/FormFieldsDefinitionsController.cs index db25539e..ab8543d9 100644 --- a/server/AyaNova/Controllers/FormFieldsDefinitionsController.cs +++ b/server/AyaNova/Controllers/FormFieldsDefinitionsController.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Logging; diff --git a/server/AyaNova/biz/BizObject.cs b/server/AyaNova/biz/BizObject.cs index 99fdfb24..ea14a3e5 100644 --- a/server/AyaNova/biz/BizObject.cs +++ b/server/AyaNova/biz/BizObject.cs @@ -66,6 +66,9 @@ namespace AyaNova.Biz _errors.Add(new ValidationError() { Code = errorCode, Message = errorMessage, Target = propertyName }); } + +//TODO: CHILD COLLECTION MOD add error version for indexed child + // //Add a bunch of errors, generally from a child object failed operastion // public void AddErrors(List errors) // { diff --git a/server/AyaNova/biz/FormFieldReference.cs b/server/AyaNova/biz/FormFieldReference.cs index a1930bff..f1ff5f6d 100644 --- a/server/AyaNova/biz/FormFieldReference.cs +++ b/server/AyaNova/biz/FormFieldReference.cs @@ -638,7 +638,7 @@ namespace AyaNova.Biz l.Add(new FormField { TKey = "PurchaseOrderCustom15", FieldKey = "PurchaseOrderCustom15", IsCustomField = true }); l.Add(new FormField { TKey = "PurchaseOrderCustom16", FieldKey = "PurchaseOrderCustom16", IsCustomField = true }); - //Items + //Customizable child Items l.Add(new FormField { TKey = "PurchaseOrderReceiptReceivedDate", FieldKey = "Items.ReceivedDate" }); l.Add(new FormField { TKey = "PurchaseOrderItemPartRequestedByID", FieldKey = "Items.PartRequestedById" }); l.Add(new FormField { TKey = "PurchaseOrderItemWorkOrderNumber", FieldKey = "Items.WorkorderItemPartRequestId" }); diff --git a/server/AyaNova/biz/RequiredFieldsValidator.cs b/server/AyaNova/biz/RequiredFieldsValidator.cs index bb82014a..d5581444 100644 --- a/server/AyaNova/biz/RequiredFieldsValidator.cs +++ b/server/AyaNova/biz/RequiredFieldsValidator.cs @@ -36,6 +36,12 @@ namespace AyaNova.Biz // if (!string.IsNullOrWhiteSpace(FF.PropertyName))//this used to work because there would be no property name but now there is so it doesn't if (!FF.IsCustomField) { + //TODO: CHILD COLLECTION MOD + /* + Update RequiredFieldsValidator to look for these period seperated items and navigate through teh collection by name / reflection to step through children and flag errors to include parent + e.g in validation error field name could be "poitems.vendorpartnumber:3" to indicate poitems collection 4th row has error in vendorpartnumber + or perhaps it makes sense to add a seperate INDEX property to make client processing easier and not a colon:index scheme in the field name (that actually makes more sense) + */ //Now get the actual property name from the available fields using the lt key string RequiredPropertyName = FF.FieldKey; diff --git a/server/AyaNova/biz/ValidationError.cs b/server/AyaNova/biz/ValidationError.cs index 6b34e1e0..a3aeba47 100644 --- a/server/AyaNova/biz/ValidationError.cs +++ b/server/AyaNova/biz/ValidationError.cs @@ -1,6 +1,6 @@ namespace AyaNova.Biz { - +//TODO: CHILD COLLECTION MOD add "Index" property to indicate child collection index location of error public class ValidationError { public ApiErrorCode Code { get; set; }