This commit is contained in:
2021-02-20 16:07:56 +00:00
parent bd9d1a6856
commit 7f8248579b
5 changed files with 11 additions and 4 deletions

View File

@@ -1,5 +1,3 @@
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Logging;

View File

@@ -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<ValidationError> errors)
// {

View File

@@ -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" });

View File

@@ -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;

View File

@@ -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; }