Ejemplo n.º 1
0
        public static async Task CheckAndCreateSubscription(Models.Transfer transfer)
        {
            var subscriptions = await _subscriptionHelper.GetSubscriptionsAsync(transfer.CustomerId);

            var doesSubscriptionExist = subscriptions != null && subscriptions.Any(x =>
                                                                                   x.CustomerId == transfer.CustomerId &&
                                                                                   x.TouchPointId == transfer.TargetTouchpointId);

            if (doesSubscriptionExist == false)
            {
                await _subscriptionHelper.CreateSubscriptionAsync(transfer);
            }
        }