public async override Task <IEnumerable <BillSummaryBO> > RunAsync(GetBillsQr process, CancellationToken cancellationToken = default)
        {
            try
            {
                var response = await p_LynxAPI.GetAsync <IEnumerable <BillSummaryBO> >(APIUriConstants.Bill, cancellationToken);

                return(response.ObjectContent);
            }
            catch (Exception ex)
            {
                p_ExceptionHandler.LogError(ex);

                return(BillSummaryBO.Empty());
            }
        }
Esempio n. 2
0
        public async override Task <UserBillBO> RunAsync(FindUserBillQr process, CancellationToken cancellationToken = default)
        {
            try
            {
                var response = await p_LynxAPI.GetAsync <UserBillBO>($"{APIUriConstants.UserBill}/{process.UserBillID}", cancellationToken);

                return(response.ObjectContent);
            }
            catch (Exception ex)
            {
                p_ExceptionHandler.LogError(ex);

                return(UserBillBO.Null());
            }
        }
Esempio n. 3
0
        public async override Task <IEnumerable <UserBillSummaryBO> > RunAsync(GetUserBillsQr process, CancellationToken cancellationToken = default)
        {
            try
            {
                var httpResponse = await p_HttpClient.GetAsync <IEnumerable <UserBillSummaryBO> >
                                   (
                    $"{APIUriConstants.UserBill}?forecastDays={process.ForecastDays}",
                    cancellationToken
                                   );

                return(httpResponse.ObjectContent);
            }
            catch (Exception ex)
            {
                p_ExceptionHandler.LogError(ex);

                return(UserBillSummaryBO.Empty());
            }
        }
        public async override Task <TextTemplateVM> RunAsync(FindTextTemplateQr request, CancellationToken cancellationToken = default)
        {
            try
            {
                var httpResponse = await p_LynxAPI.GetAsync <TextTemplateVM>
                                   (
                    $"{APIUriConstants.TextTemplate}/{request.Code}",
                    cancellationToken
                                   );

                return(httpResponse.ObjectContent);
            }
            catch (Exception ex)
            {
                p_ExceptionHandler.LogError(ex);

                return(new TextTemplateVM
                {
                    Content = ex.Message
                });
            }
        }