This commit is contained in:
2020-07-31 21:54:06 +00:00
parent 5dd44dfdf5
commit a760112691

View File

@@ -481,8 +481,9 @@ namespace AyaNova.Biz
}
else
{
//verify that client exists
//TODO WHEN CLIENT OBJECT MADE if(!ct.Client.any(z))
//verify chosen customer exists
if (!await ct.Customer.AnyAsync(z => z.Id == proposedObj.CustomerId))
AddError(ApiErrorCode.NOT_FOUND, "CustomerId");
}
}
@@ -495,12 +496,13 @@ namespace AyaNova.Biz
}
else
{
//verify that HeadOfficeId exists
//TODO WHEN HEADOFFICE OBJECT MADE if(!ct.HeadOffice.any(z))
//verify chosen HO exists
if (!await ct.HeadOffice.AnyAsync(z => z.Id == proposedObj.HeadOfficeId))
AddError(ApiErrorCode.NOT_FOUND, "HeadOfficeId");
}
}
//Validate headoffice type user
//Validate subcontractor type user
if (!SeedOrImportRelaxedRulesMode && proposedObj.UserType == UserType.ServiceContractor)
{
if (proposedObj.SubVendorId == null || proposedObj.SubVendorId == 0)
@@ -510,7 +512,8 @@ namespace AyaNova.Biz
else
{
//verify that VENDOR SubVendorId exists
//TODO WHEN VENDOR OBJECT MADE if(!ct.Vendor.any(z))
if (!await ct.Vendor.AnyAsync(z => z.Id == proposedObj.SubVendorId))
AddError(ApiErrorCode.NOT_FOUND, "SubVendorId");
}
}