Search Results for

    Show / Hide Table of Contents

    Interface IStatsService

    Provides methods to get calculated stats and to trigger stats processes to run.

    Namespace: DirectScale.Disco.Extension.Services
    Assembly: DirectScale.Disco.Extension.Abstractions.dll
    Syntax
    public interface IStatsService

    Methods

    GetStats(Int32[], DateTime)

    Gets all the stats for associateIDs for the period containing date.

    Declaration
    Task<Dictionary<int, CommissionStats>> GetStats(int[] associateIDs, DateTime date)
    Parameters
    Type Name Description
    System.Int32[] associateIDs

    These are the associates to get the stats for.

    System.DateTime date

    The stats are retrieved for the commission period containing this date.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.Int32, CommissionStats>>

    A dictionary of Key: AssociateId Value: stats for all associateIDs passed in. If no stats are found for the associate, they will still exist in the dictionary with the CommissionStats value being an empty default object full of zeros. null if a stats template isn't defined (Should never happen).

    Remarks

    Only commission values found in the stats template will be returned. For example, it is common to have a main monthly template and a weekly template. In this case, only values defined in the monthly template will be returned, none from the weekly template.

    See Also
    CommissionStats
    IHistoryService

    ProcessStatsQueue()

    Triggers a stats run to pick up any queued items, such as orders placed. If stats is already running, it will schedule another run as soon as the current process finished.

    Declaration
    Task ProcessStatsQueue()
    Returns
    Type Description
    System.Threading.Tasks.Task
    Remarks

    Calling this method is uncommon since most ways to modify volume will trigger a stats run already.

    RecalculateVolume(VolumeSource)

    Adds an associate to the stats queue to recalculate their volume, then triggers a stats run to begin ProcessStatsQueue().

    Declaration
    Task RecalculateVolume(VolumeSource volumeSource)
    Parameters
    Type Name Description
    VolumeSource volumeSource

    The associate information to queue.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Remarks

    Each time stats run, only those associates who have had volume changes in their downline will be processed. This method will manually add associates to be processed, which can be useful when troubleshooting if someone's stats look incorrect. Creating a custom endpoint to call this method would be useful for that purpose

    See Also

    IHistoryService
    In This Article
    Back to top Copyright © 2022 DirectScale
    Generated by DocFX