Пример #1
0
 public SpendService(ISupplierService supplierService, ISpendService spendService, IFailoverInvoiceService failoverInvoiceService, ILoggerFactory loggerFactory)
 {
     this._supplierService        = supplierService;
     this._failoverInvoiceService = failoverInvoiceService;
     this._spendService           = spendService;
     this._logger = loggerFactory.CreateLogger <SpendService>();
 }
Пример #2
0
 public SpendModule(ISpendService spendService)
 {
     Get["/spend"] = _ =>
     {
         var spendIdea = spendService.GetRandomIdea();
         return(Response.AsJson(spendIdea));
     };
 }
Пример #3
0
        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;
 }
Пример #5
0
 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;
     }
 }
Пример #6
0
 public SpendSummaryController(ISpendService spendService)
 {
     this.spendService = spendService;
 }
Пример #7
0
 public SummaryService(ITransactionService transactionService, ISpendService spendService, IAssetService assetService)
 {
     _transactionService = transactionService;
     _spendService       = spendService;
     _assetService       = assetService;
 }
Пример #8
0
 public SpendsController(ISpendService spendService, ICategoryRepository categoryRepository)
 {
     _spendService       = spendService;
     _categoryRepository = categoryRepository;
 }
Пример #9
0
 public SpendsController(ISpendService spendService)
 {
     _spendService = spendService;
 }