This commit is contained in:
2020-12-17 20:57:43 +00:00
parent c59fd9e9ac
commit ec4a778b97

View File

@@ -151,7 +151,8 @@ namespace AyaNova.Biz
try try
{ {
Review dbObject = await ct.Review.SingleOrDefaultAsync(m => m.Id == id); Review dbObject = await ct.Review.SingleOrDefaultAsync(m => m.Id == id);
if (dbObject == null){ if (dbObject == null)
{
AddError(ApiErrorCode.NOT_FOUND); AddError(ApiErrorCode.NOT_FOUND);
return false; return false;
} }
@@ -210,13 +211,15 @@ namespace AyaNova.Biz
private async Task ValidateAsync(Review proposedObj, Review currentObj) private async Task ValidateAsync(Review proposedObj, Review currentObj)
{ {
//TODO: Specific rules see case 3511
bool isNew = currentObj == null; bool isNew = currentObj == null;
//Name required //Name required
if (string.IsNullOrWhiteSpace(proposedObj.Name)) if (string.IsNullOrWhiteSpace(proposedObj.Name))
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
//If name is otherwise OK, check that name is unique //If name is otherwise OK, check that name is unique
if (!PropertyHasErrors("Name")) if (!PropertyHasErrors("Name"))
@@ -247,6 +250,7 @@ namespace AyaNova.Biz
private void ValidateCanDelete(Review inObj) private void ValidateCanDelete(Review inObj)
{ {
//whatever needs to be check to delete this object //whatever needs to be check to delete this object
//TODO: There are specific rules for this beyond regular roles see case 3511
} }
@@ -398,7 +402,7 @@ namespace AyaNova.Biz
await JobsBiz.LogJobAsync(job.GId, ExceptionUtil.ExtractAllExceptionMessages(ex)); await JobsBiz.LogJobAsync(job.GId, ExceptionUtil.ExtractAllExceptionMessages(ex));
} }
} }
await JobsBiz.LogJobAsync(job.GId, $"LT:BatchJob {job.SubType} {idList.Count}{(FailedObjectCount > 0 ? " - LT:Failed " + FailedObjectCount : "")}"); await JobsBiz.LogJobAsync(job.GId, $"LT:BatchJob {job.SubType} {idList.Count}{(FailedObjectCount > 0 ? " - LT:Failed " + FailedObjectCount : "")}");
await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Completed); await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Completed);
} }