This commit is contained in:
2021-01-05 18:32:56 +00:00
parent 9786713f96
commit a339533701
2 changed files with 178 additions and 5 deletions

View File

@@ -268,9 +268,16 @@ namespace AyaNova.Biz
}
private void ValidateCanDelete(Unit inObj)
private async Task ValidateCanDelete(Unit inObj)
{
//whatever needs to be check to delete this object
//Can't delete a unit if it's a shadow unit for a loanunit
if (await ct.LoanUnit.AnyAsync(z => z.UnitId == inObj.Id))
{
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", "LT:LoanUnit");
}
}
@@ -528,10 +535,10 @@ namespace AyaNova.Biz
//MIGRATE_OUTSTANDING need meter reading object to complete unit notification for UnitMeterReadingMultipleExceeded
//UnitMeterReadingMultipleExceeded = 26,//* UnitMeterReading object, Created, conditional on DecValue as the Multiple threshold, if passed then notifies
//{
//first remove any existing, potentially stale notifyevents for this exact object and notifyeventtype
//await NotifyEventHelper.ClearPriorEventsForObject(ct, AyaType.Unit, o.Id, NotifyEventType.UnitMeterReadingMultipleExceeded);
//first remove any existing, potentially stale notifyevents for this exact object and notifyeventtype
//await NotifyEventHelper.ClearPriorEventsForObject(ct, AyaType.Unit, o.Id, NotifyEventType.UnitMeterReadingMultipleExceeded);
//then check if unit is still metered etc etc and do the rest once the unit meter reading is coded
//then check if unit is still metered etc etc and do the rest once the unit meter reading is coded