/// <summary>
        /// Get active provisions
        /// </summary>
        /// <returns>The active provisions</returns>
        public async Task <List <SubscriptionProvision> > GetInProgressProvisionsAsync()
        {
            List <SubscriptionProvision> statusList = new List <SubscriptionProvision>();
            List <Subscription>          subList    = await _context.Subscriptions.ToListAsync();

            foreach (var sub in subList)
            {
                if (sub.Status.Equals(nameof(FulfillmentState.Unsubscribed)))
                {
                    Plan plan = await FindPlanById(sub.PlanId);

                    if (sub.UnsubscribedTime.Value.AddDays(plan.DataRetentionInDays) > DateTime.UtcNow)
                    {
                        continue;
                    }
                }
                else if (ProvisioningHelper.isFinalProvisioningState(sub.ProvisioningStatus))
                {
                    continue;
                }

                statusList.Add(new SubscriptionProvision
                {
                    SubscriptionId     = sub.SubscriptionId,
                    ProvisioningStatus = sub.ProvisioningStatus,
                    ProvisioningType   = sub.ProvisioningType,
                    RetryCount         = sub.RetryCount,
                    LastException      = sub.LastException,
                    SubscriptionStatus = sub.Status
                });
            }

            return(statusList);
        }