public SpendService(ISupplierService supplierService, ISpendService spendService, IFailoverInvoiceService failoverInvoiceService, ILoggerFactory loggerFactory) { this._supplierService = supplierService; this._failoverInvoiceService = failoverInvoiceService; this._spendService = spendService; this._logger = loggerFactory.CreateLogger <SpendService>(); }
public SpendModule(ISpendService spendService) { Get["/spend"] = _ => { var spendIdea = spendService.GetRandomIdea(); return(Response.AsJson(spendIdea)); }; }
public SpendSummary GetTotalSpend(int supplierId) { ISupplierInvoice supplierInvoiceFactory = new SupplierInvoiceFactory(); ISpendService spendService = supplierInvoiceFactory.GetSupplierInvoice(supplierId); return(spendService.GetTotalSpend()); //return null; }
public SMSApprovalService(IRepository repository, ISaveService saveService, ISpendService spendService, ICharityService charityService, IChoreService choreService, ISMSApprovalHistory smsApprovalHistory) : base(repository) { _saveService = saveService; _spendService = spendService; _charityService = charityService; _choreService = choreService; _smsApprovalHistory = smsApprovalHistory; }
public SpendSummary GetTotalSpend(int supplierId) { _logger.LogInformation($"Calling Total spend for {supplierId}"); try { var supplier = _supplierService.GetById(supplierId); _spendService = supplier.IsExternal ? (ISpendService) new ExternalServiceWrapper(_failoverInvoiceService) : new InvoiceRepository(); return(_spendService.GetTotalSpend(supplierId)); } catch (CustomException) { _logger.LogError($"GetTotalSpend is failed to acquire data for external supplier {supplierId} from both locations."); return(null); // sending out null intentionally. } catch (Exception ex) { _logger.LogError($"Error occured. Error message is {ex.Message}"); throw; } }
public SpendSummaryController(ISpendService spendService) { this.spendService = spendService; }
public SummaryService(ITransactionService transactionService, ISpendService spendService, IAssetService assetService) { _transactionService = transactionService; _spendService = spendService; _assetService = assetService; }
public SpendsController(ISpendService spendService, ICategoryRepository categoryRepository) { _spendService = spendService; _categoryRepository = categoryRepository; }
public SpendsController(ISpendService spendService) { _spendService = spendService; }