This commit is contained in:
@@ -210,9 +210,13 @@ 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
|
- RULE Roles: BizAdminFull, DispatchFull, InventoryFull, Accounting, SalesFull can create and assign to anyone else.
|
||||||
|
- RULE Any other inside role can create for themselves only. (outside roles have no rights to this object so no need to check)
|
||||||
|
- RULE Limited roles can only set completed date and enter completion notes not otherwise change or create or delete.
|
||||||
|
- BIZ RULE users with more than limited roles can assign other users to follow up. Limited roles can only set completed status not otherwise change or create or delete.
|
||||||
|
*/
|
||||||
|
|
||||||
bool isNew = currentObj == null;
|
bool isNew = currentObj == null;
|
||||||
|
|
||||||
//Name required
|
//Name required
|
||||||
@@ -221,16 +225,6 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//If name is otherwise OK, check that name is unique
|
|
||||||
if (!PropertyHasErrors("Name"))
|
|
||||||
{
|
|
||||||
//Use Any command is efficient way to check existance, it doesn't return the record, just a true or false
|
|
||||||
if (await ct.Review.AnyAsync(m => m.Name == proposedObj.Name && m.Id != proposedObj.Id))
|
|
||||||
{
|
|
||||||
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//Any form customizations to validate?
|
//Any form customizations to validate?
|
||||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.Review.ToString());
|
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.Review.ToString());
|
||||||
|
|||||||
Reference in New Issue
Block a user