This commit is contained in:
2021-08-23 23:25:20 +00:00
parent 042e3efb8e
commit 36d3bfedfd
4 changed files with 78 additions and 13 deletions

View File

@@ -229,6 +229,22 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "DeliveryAddress", "In app delivery should not specify a delivery address");
}
if (proposedObj.EventType == NotifyEventType.UnitMeterReadingMultipleExceeded)
{
//validate decvalue is a long
try
{
long lValue= System.Convert.ToInt64(proposedObj.DecValue);
if(lValue < 5){//arbitrary value
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "DecValue", "Value is too small, must be 5 or higher");
}
}
catch (System.OverflowException)
{
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "DecValue", "Value is too large, must be less than 9,223,372,036,854,775,807");
}
}
}