コード例 #1
0
        public async Task <IncomeAndExpenditure> GetPartiallySavedIncomeAndExpenditure(string loggedInUserId, Guid caseflowUserId)
        {
            if (loggedInUserId == null)
            {
                return(null);
            }
            if (!_portalSettings.Features.EnablePartialSave)
            {
                return(null);
            }

            var innerUrl = $"{_portalSettings.GatewayEndpoint}api/BudgetCalculator/GetPartialSavedIncomeAndExpenditure";

            var dto = new PartialBudgetApiRequest
            {
                CaseflowUserId = caseflowUserId
            };

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

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

            return(_mapper.Map <IncomeAndExpenditure>(result));
        }
コード例 #2
0
        public async Task RemovePartialSaved(Guid caseflowUserId)
        {
            var innerUrl = $"{_portalSettings.GatewayEndpoint}api/BudgetCalculator/RemovePartialSavedIncomeAndExpenditure";

            var budget = new PartialBudgetApiRequest
            {
                CaseflowUserId = caseflowUserId
            };

            await _restClient.PostNoResponseAsync(innerUrl, budget);
        }