Пример #1
0
        public async Task <OperationResponse <InternalBridgeCreateQuoteOutput> > Upsert(AbstractProduct input)
        {
            var result  = new OperationResponse <InternalBridgeCreateQuoteOutput>();
            var payload = new InternalBridgeCreateQuoteInput {
            };

            var resultContent = (await this.QuoteClient.CreateQuote(payload)).Content;

            var resultMap = new InternalBridgeCreateQuoteOutput
            {
            };

            result.Bag = resultMap;

            return(result);

            //var client = new RestClient(endpointURL);
            //var internalInput = new FunzaQuoteGetItemsCommandFunzaInputDTO
            //{
            //    SkipCount = input.PageIndex * input.PageSize,
            //    MaxResultCount = input.PageSize == default(int) ? 10 : input.PageSize,
            //};
            //if (!string.IsNullOrWhiteSpace(input.CustomFilter.Term))
            //{
            //    internalInput.Nombre = input.CustomFilter.Term.Trim();
            //}

            //var request = new RestRequest(Method.GET);
            //request.AddObject(internalInput);
            //request.AddHeader("Authorization", $"Bearer {accessToken}");

            //var response = client.Execute<FunzaPageResult<FunzaQuoteGetItemsCommandFunzaOutputDTO>>(request);

            //if (response.Data != null && response.Data.Success)
            //{
            //    result.Bag = MappingQuoteGetAllResult(response);
            //}

            return(result);
        }
Пример #2
0
        public async Task <IActionResult> Add(InternalBridgeCreateQuoteInput model)
        {
            var payload = new FunzaDirectCreateQuoteInput {
                Titulo         = model.Title,
                TemporadaId    = model.SeasonId,
                TipoProductoId = model.ProductTypeId
            };

            await this.QuoteClient.SetFunzaToken(this.Request);

            //var quoteClient = RestService.For<IQuoteClient>(RefitConfig.GetHttpClient());

            //var funzaResponse = await quoteClient.CreateQuote(payload);
            var funzaResponse = await this.QuoteClient.CreateQuote(payload);

            var funzaResult = funzaResponse.Content;

            var result = new InternalBridgeCreateQuoteOutput
            {
                Title = funzaResult.Titulo
            };

            return(this.Ok(result));
        }