public async Task <IncomeAndExpenditureApiModel> GetIncomeAndExpenditure(string lowellReference)
        {
            var innerUrl = $"{_baseUrl}api/BudgetCalculator/GetSavedIncomeAndExpenditure";

            var dto = new IncomeAndExpenditureApiRequest
            {
                LowellReference = lowellReference
            };

            return(await _restClient.PostAsync <IncomeAndExpenditureApiRequest, IncomeAndExpenditureApiModel>(innerUrl,
                                                                                                              dto));
        }
Пример #2
0
        public async Task <IncomeAndExpenditure> GetSavedIncomeAndExpenditure(string lowellReference)
        {
            var innerUrl = $"{_portalSettings.GatewayEndpoint}api/BudgetCalculator/GetSavedIncomeAndExpenditure";

            var dto = new IncomeAndExpenditureApiRequest
            {
                LowellReference = lowellReference
            };

            IncomeAndExpenditureApiModel result =
                await _restClient.PostAsync <IncomeAndExpenditureApiRequest, IncomeAndExpenditureApiModel>(innerUrl, dto);

            if (result == null || result.Created < DateTime.UtcNow.AddDays(-180))
            {
                return(null);
            }

            return(_mapper.Map <IncomeAndExpenditure>(result));
        }