コード例 #1
0
        public Lead(LeadType type, string mobileNo_, Opt <string> firstName_ = default, bool stopAfterConfirmation_ = false)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(mobileNo_));

            MobileNo              = mobileNo_;
            FirstName             = firstName_;
            StopAfterConfirmation = stopAfterConfirmation_;
            Status    = LeadStatus.New;
            CreatedOn = UtcDateTime.Now;

            LeadTypeId   = type.Id;
            Confirmation = type.NewInterestConfirmation(this);
            Application  = null;
        }
コード例 #2
0
ファイル: LeadType.cs プロジェクト: techtree-za/swoosh-mobile
        public static Application NewApplication(LeadType type, Lead lead)
        {
            Contract.Requires(type != null);
            Contract.Requires(lead != null);

            var application =
                type.Id switch {
                LeadTypes.InboundLeads => InboundLeadType_NewApplication(lead, UtcDateTime.Now),
                LeadTypes.OutboundLeads => OutboundLeadType_NewApplication(lead, UtcDateTime.Now),
                LeadTypes.UpgradeLeads => UpgradeLeadType_NewApplication(lead, UtcDateTime.Now),
                _ => throw new NotSupportedException($"The LeadType::Id: {type.Id} is not supported.")
            };

            return(application);
        }
コード例 #3
0
ファイル: LeadType.cs プロジェクト: techtree-za/swoosh-mobile
        public static Result ValidateRequiredFields(LeadType type, Lead lead)
        {
            Contract.Requires(type != null);
            Contract.Requires(lead != null);

            var validationResult =
                type.Id switch {
                LeadTypes.InboundLeads => InboundLeadType_ValidateRequiredData(lead),
                LeadTypes.OutboundLeads => OutboundLeadType_ValidateRequiredData(lead),
                LeadTypes.UpgradeLeads => UpgradeLeadType_ValidateRequiredData(lead),
                _ => throw new NotSupportedException($"The LeadType::Id: {type.Id} is not supported.")
            };

            return(validationResult);
        }
コード例 #4
0
 public void StartNewApplication(LeadType type)
 {
     Application = type.NewApplication(this);
     Status      = LeadStatus.Application;
 }