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); }
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)); }
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)); }