Search Results for

    Show / Hide Table of Contents

    Interface IEnrollmentService

    Used to enroll new associate, also exposes some methods that are called during WriteApplication(Application, Boolean).

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

    Methods

    SendWelcomeEmail(Int32, String, String, String, Int32)

    Triggers the welcome email to be sent.

    Declaration
    Task SendWelcomeEmail(int associateId, string firstName, string lastName, string emailAddress, int associateBaseType)
    Parameters
    Type Name Description
    System.Int32 associateId

    Associate's id.

    System.String firstName

    Associate's first name.

    System.String lastName

    Associate's last name.

    System.String emailAddress

    The email address to send the email to.

    System.Int32 associateBaseType

    Associate's type.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Remarks

    The welcome email template is configured in settings.

    ValidateEmail(String)

    Validates that the email address is unique.

    Declaration
    Task ValidateEmail(string email)
    Parameters
    Type Name Description
    System.String email

    Email address to check.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Remarks

    Calls IsEmailAvailable.

    Exceptions
    Type Condition
    System.Exception

    If email is empty or used.

    ValidateEnrollerBirthDate(DateTime)

    Verifies that dob is older than the age requirement to enroll.

    Declaration
    Task ValidateEnrollerBirthDate(DateTime dob)
    Parameters
    Type Name Description
    System.DateTime dob

    The associate's date of birth.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Remarks

    This uses the "Enroller Age" setting, but defaults to 18 years old if the setting is not set.

    Exceptions
    Type Condition
    System.Exception

    If dob is empty or too young.

    ValidateUsername(String)

    Declaration
    Task ValidateUsername(string username)
    Parameters
    Type Name Description
    System.String username
    Returns
    Type Description
    System.Threading.Tasks.Task

    ValidateUsernameUpgrade(String, Int32, Boolean)

    Declaration
    Task ValidateUsernameUpgrade(string username, int associateId, bool isAssociateUpgrade)
    Parameters
    Type Name Description
    System.String username
    System.Int32 associateId
    System.Boolean isAssociateUpgrade
    Returns
    Type Description
    System.Threading.Tasks.Task

    WriteApplication(Application, Boolean)

    Used to create a new associate. Also is used to upgrade an associate, see IsAssociateUpgrade.

    Declaration
    Task<ApplicationResponse> WriteApplication(Application application, bool sendEmails)
    Parameters
    Type Name Description
    Application application

    All of the details about the applicatio.

    System.Boolean sendEmails

    True if you want a welcome email to be sent to the new associate.

    Returns
    Type Description
    System.Threading.Tasks.Task<ApplicationResponse>

    The newly created associate's id and the status of their payment.

    Remarks

    SendWelcomeEmail(Int32, String, String, String, Int32), ValidateEmail(String), and ValidateEnrollerBirthDate(DateTime) are all called within this process, and many other operations to create the associate, their order, their websites, etc.

    Exceptions
    Type Condition
    System.Exception

    Thrown if any of the extensive validation fails. See System.Exception.Message for details.

    See Also
    WriteApplication
    ValidateApplication
    IsEmailAvailable
    IsTaxIdAvailable
    UpdateAssociateBaseType

    See Also

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