/// <summary> /// It is taking all accounts from Account API /// and applying the service charge to those accounts who don't maintain miniumum balance /// </summary> public void RunMonthlyJob() { try { List <Account> AllAcc = _rules.GetAccounts(); foreach (var x in AllAcc) { if (x.Balance < x.minBalance) { float ServiceCharge = GetServiceCharge(x.AccountType); var status = _charge.ApplyServiceCharge(x.AccountId, (int)ServiceCharge); if (status.Message == "Your account has been credited") { _log4net.Info("Service charge deducted for the AccountID = " + x.AccountId); } else { _log4net.Info("Some Issue occured while deducting service charge for the AccountID = " + x.AccountId); } } } } catch (NullReferenceException e) { throw e; } catch (Exception e) { _log4net.Error("Exception in RunMonthlyJob() in MonthlyJobProvider"); _log4net.Error(e.Message); throw e; } }