Data Point Providers

A data point provider is a named entity that handles data points within Corporate Admin.



Defined Data Point Providers

The following is a list of the currently supported data point providers.

  • Associate
  • Order
  • AutoShip
  • Associate Stats
  • Service
  • System (only use with non-Associate-based data points, such as: Today or Now)


Data Point Provider and Data Point Matrix

The following are the data points called by a specific data point provider.


AssociateDataPointProvider

DataPointData TypeAggregate?Description
NameTextNoThe full name of the Associate.
DisplayFirstNameTextNoThe display first name of the Associate.
DisplayLastNameTextNoThe display last name of the Associate.
SignUpDateDate/TimeNoThe enrollment date of the Associate.
StatusIdNumberNoThe Associate's account status (Active, Inactive, Disabled, etc.).

AssociateStatsDataPointProvider

DataPointData TypeAggregate?Description
CVNumberNoThe CV of the Associate.
QVNumberNoThe QV of the Associate.
KitLevelsNumberNoThe Associates current kit level.
PeriodKitLevelsNumber ArrayNoThe kit numbers the Associate has purchased.
GroupVolumeNumberNoThe volume of the Associate's downline.
PlaceTreeStrongLegTextNoLeg name for Associates current strong leg.
PlaceTreeWeakLegTextNoLeg name for Associates current weak leg.
RankNumberNoThe rank of the Associate.
LastRankNumberNoThe previous rank of the Associate.
HighestRankNumberNoThe highest rank the Associate has achieved.
ActiveYes/NoNoThe Associate Active status according to the compensation plan, not the manually set Associate status.
CommissionAmountNumberNo
RankOptionsComplex ObjectNoWhat the Associates has done relating to what is required for each rank.

AutoShipDataPointProvider

DataPointData TypeAggregate?Description
NextProcessedDateDate/TimeNoThe date the Associate's AutoShip processes.

ServiceDataPointProvider

DataPointData TypeAggregate?Description
ServiceIdNumberNoThe numeric ID of the service (defines the type of service).
ServiceExpirationDateDate/TimeNoThe date the specified service discontinues/expires.
ServiceExpirationDateDate/TimeYesThe Associate's services expiration date.

OrderDataPointProvider

DataPointData TypeAggregate?Description
CommissionDateDate/TimeNoThe date commissions were paid for the associated order.
HasPayedAnyOrderYes/NoYesIndicates whether any of the Associate's orders have been paid.
StatusNameStringNoString value of the Order Status.
TypeIdIntNoInt value of the Order Type.
TypeNameStringNoString value of Order Type.

SystemDataPointProvider

DataPointData TypeAggregate?Description
TodayDate/TimeNoTracks today's date. Used mostly for system data point tasks.

Creating DataPoint Providers

If your data point isn't available in an existing provider, the you can create a new data point provider:

public DataPointValue[] GetDataPointValues(IEnumerable<DataPoint> requestedPoints)
{
    var statsDataPoints = new List<DataPointValue>;
    if (requestedPoints.Any())
    {
        // Validating that the passed-in DataPointIds are valid
        try
        {
            DataPointsUtilities.ValidateDataPointIds(this, requestedPoints.Select(x => x.Id));
        }
        catch (Exception ex)
        {
            _loggingServices.LogError(ex.Message, ex);
            throw;
        }

        var associateIds = new HashSet<int>(requestedPoints.Select(x => x.AssociateId)).ToArray();
        var commissionStats = _statsService.GetAssociateStats(associateIds, DateTime.Today) ?? new Dictionary<int, CommissionStats>();
        foreach (var dataPoint in requestedPoints)
        {
            if (commissionStats.TryGetValue(dataPoint.AssociateId, out var associateStats) && associateStats != null)
            {
                statsDataPoints.Add(AssignAssociateStatsDataPoints(associateStats, dataPoint));
            }
            else
            {
                statsDataPoints.Add(new DataPointValue)
                {
                    DataPoint = dataPoint,
                    Value = null
                });
            }
        }
    }

    return statsDataPoints.ToArray();
}