示例#1
0
        public async Task <List <BonusCustomerResponseModel> > TriggerBonusToCustomersAsync(
            [FromBody] BonusCustomersRequestModel model)
        {
            var partnerId = _requestContext.UserId;

            model.BonusCustomers.ForEach(x => x.SetPartnerId(partnerId));

            var sanitizedModel = model.BonusCustomers.Select(x => new
            {
                x.CustomerId,
                Email = x.Email.SanitizeEmail(),
                x.Currency,
                x.FiatAmount,
                x.LocationId,
                PartnerId = x.GetPartnerId(),
                x.PaymentTimestamp,
                x.PosId
            }).ToList();

            _log.Info("Trigger bonus to customers started", sanitizedModel);

            var result = await _bonusService.TriggerBonusToCustomersAsync(model);

            _log.Info("Trigger bonus to customers finished", sanitizedModel);

            return(result);
        }
示例#2
0
        public async Task <List <BonusCustomerResponseModel> > TriggerBonusToCustomersAsync(BonusCustomersRequestModel model)
        {
            var request = _mapper.Map <Lykke.Service.PartnersIntegration.Client.Models.BonusCustomersRequestModel>(model);

            var result = await _partnersIntegrationClient.BonusApi.TriggerBonusToCustomers(request);

            return(_mapper.Map <List <BonusCustomerResponseModel> >(result));
        }
示例#3
0
        public async Task <List <BonusCustomerResponseModel> > TriggerBonusToCustomers(BonusCustomersRequestModel model)
        {
            var responseContracts = await _bonusService.TriggerBonusToCustomersAsync(
                _mapper.Map <List <BonusCustomerRequest> >(model.BonusCustomers));

            return(_mapper.Map <List <BonusCustomerResponseModel> >(responseContracts));
        }