Beispiel #1
0
 public Email(LeadPayload _LeadPayload, Guid contactGuid)
 {
     ContactGuid          = contactGuid;
     Email_Address        = _LeadPayload._PayloadBody.Email;
     Alternate_Email_1__c = _LeadPayload._PayloadBody.AlternateEmail1__C;
     Alternate_Email_2__c = _LeadPayload._PayloadBody.AlternateEmail2__C;
     Alternate_Email_3__c = _LeadPayload._PayloadBody.AlternateEmail3__C;
 }
Beispiel #2
0
 public PhoneNumbers(LeadPayload _LeadPayload, Guid contactGuid)
 {
     ContactGuid           = contactGuid;
     Phone                 = _LeadPayload._PayloadBody.Phone;
     MobilePhone           = _LeadPayload._PayloadBody.MobilePhone;
     Home_Phone__c         = _LeadPayload._PayloadBody.Home_Phone__c;
     Work_Phone__c         = _LeadPayload._PayloadBody.Work_Phone__c;
     Other_Phone__c        = _LeadPayload._PayloadBody.Other_Phone__c;
     Additional_Phone_Data = _LeadPayload._PayloadBody.Additional_Phone_Data;
 }
Beispiel #3
0
 public Customer(
     LeadPayload _LeadPayload,
     Guid programGuid,
     Guid subprogramGuid)
 {
     CustomerGuid         = _LeadPayload._PayloadHeader.CmcCustomerGuidC;
     ProgramGuid          = programGuid;
     SubProgramGuid       = subprogramGuid;
     BillingAccountNumber = _LeadPayload._PayloadHeader.BillAccountNumberC;
     //CustomerAccountTypeGuid = customerAccountTypeGuid;
 }
Beispiel #4
0
        public Lead(LeadPayload leadPayload, Guid leadStatusGuid, Guid CmcAuditType)
        {
            CustomerGuid = leadPayload._PayloadHeader.CmcCustomerGuidC;
            SFLeadID     = leadPayload._PayloadHeader.RecordIdC;

            LeadStatusGuid         = leadStatusGuid;
            QualifiedAuditTypeGuid = CmcAuditType;

            LeadStatusName   = leadPayload._PayloadBody.Status;
            LeadSource       = leadPayload._PayloadBody.LeadSource;
            LeadStatusReason = leadPayload._PayloadBody.StatusReasonC;
            AuditTypeName    = leadPayload._PayloadBody.AuditTypeC;
            //ReservedDate is a non nullable column in the database
            ReservedDate          = leadPayload._PayloadBody.ReservedDateC ?? Convert.ToDateTime("1900-01-01");
            NextAvailableCallDate = leadPayload._PayloadBody.NextAvailableCallDateC ?? Convert.ToDateTime("1900-01-01");
            //TODO Not there yet?
            QualifiedRate = null;
        }
Beispiel #5
0
        // For Primary Contact
        public Contact(LeadPayload _LeadPayload, Guid contactTypeGuid)
        {
            CustomerGuid    = _LeadPayload._PayloadHeader.CmcCustomerGuidC;
            ContactTypeGuid = contactTypeGuid;

            ContactTypeName       = _LeadPayload._PayloadBody.ContactTypeC;
            FirstName             = _LeadPayload._PayloadBody.FirstName;
            MiddleName            = _LeadPayload._PayloadBody.MiddleName;
            LastName              = _LeadPayload._PayloadBody.LastName;
            FullName              = _LeadPayload._PayloadBody.Name;
            InformalName          = _LeadPayload._PayloadBody.InformalNameC;
            Salutation            = _LeadPayload._PayloadBody.Salutation;
            Suffix                = _LeadPayload._PayloadBody.Suffix;
            Title                 = _LeadPayload._PayloadBody.Title;
            IsAnyContactAllowed   = _LeadPayload._PayloadBody.IsAnyContactAllowedC;
            IsVoiceContactAllowed = _LeadPayload._PayloadBody.IsVoiceContactAllowedC;
            IsSmsContactAllowed   = _LeadPayload._PayloadBody.IsSmsContactAllowedC;
            IsAutoCallAllowed     = _LeadPayload._PayloadBody.IsAutoCallAllowedC;
            IsEmailContactAllowed = _LeadPayload._PayloadBody.IsEmailContactAllowedC;
        }
        public async Task <int> UpdateLeadFromLeadPayload_GUID(LeadPayload leadPayload, LogCommand logCommand)
        {
            //Logging Helper for Method
            var method_name = "UpdateLeadFromLeadPayload_GUID";

            var UpdateQuery = " update _LeadTable " +
                              " set  " +
                              "  _LeadTable.[SFLeadID] = @ID " +
                              " ,_LeadTable.[LeadStatusGuid] = _LeadStatus.LeadStatusGuid " +
                              " ,_LeadTable.LeadSource = @LeadSource " +
                              " ,_LeadTable.QualifiedAuditTypeGuid = _AuditType.AuditTypeGuid " +

                              " From [CMC-SFDC_DEV].[Customer].[Lead] as _LeadTable " +
                              " join customer.LkpAuditType as _AuditType " +
                              " on _AuditType.AuditTypeName = @AuditTypeC " +
                              " join Customer.LkpLeadStatus as _LeadStatus " +
                              " on _LeadStatus.LeadStatusName = @Status " +
                              " where _LeadTable.CustomerGuid = @CmcCustomerGuidC ";


            //Log the input
            logCommand.LogMessage = $"{Repository}.{method_name} Starting input parameters CDCResponseObject = {JsonConvert.SerializeObject(leadPayload)}" + Environment.NewLine +
                                    $"Query: {UpdateQuery}";
            _logHandler.HandleLog(logCommand);


            using (var connection = _connectionFactory.GetConnection)
            {
                //Await the response
                var returnValue = await connection.ExecuteAsync(UpdateQuery, leadPayload);

                connection.Close();

                //Log the output
                logCommand.LogMessage = $"{Repository}.{method_name} completed";
                _logHandler.HandleLog(logCommand);

                return(returnValue);
            }
        }
Beispiel #7
0
        public async Task <int> UpdateUsageFromLeadCDC(LeadPayload cdcResponseObject, LogCommand logCommand)
        {
            //Logging Helper for Method
            var method_name = "UpdateUsageFromLeadCDC";

            var BaseQuery = "update [Customer].[Usage]  ";

            var set_statement = " set ";
            var JoinQuery     = "  FROM [Client].[Usage] as _usage " +
                                "  join Customer.Account as _account " +
                                "  on _usage.AccountGuid = _account.CustomerAccountId   ";

            //var CountSets = 0;

            //Build the Query
            var query = BaseQuery + " " +
                        set_statement + " " +
                        JoinQuery + " ";

            //Log the input
            logCommand.LogMessage = $"{Repository}.{method_name} Starting input parameters CDCResponseObject = {JsonConvert.SerializeObject(cdcResponseObject)}" + Environment.NewLine +
                                    $"Query: {query}";
            _logHandler.HandleLog(logCommand);


            using (var connection = _connectionFactory.GetConnection)
            {
                //Await the response
                var returnValue = await connection.ExecuteAsync(query);

                connection.Close();

                //Log the output
                logCommand.LogMessage = $"{Repository}.{method_name} completed";
                _logHandler.HandleLog(logCommand);

                return(returnValue);
            }
        }
 public Task <int> UpdateLeadFromLeadPayload(LeadPayload cDcResponseObject, LogCommand logCommand)
 {
     throw new NotImplementedException();
 }
        public async Task <GenericServiceResponse> UpsertLeadFromInsertEvent(PayloadParent cdcResponseObject, LogCommand logCommand)
        {
            const string method           = "UpsertLeadFromInsertEvent";
            string       upsertEventState = string.Empty;

            try
            {
                logCommand.LogMessage = $"{Service}.{method} Starting input parameter CDCResponseObject = {cdcResponseObject}";
                _logHandler.HandleLog(logCommand);

                var checkIfExists = await _leadRepository.GetLeads(cdcResponseObject.CmcCustomerGuidC, logCommand);

                var leadPayload = new LeadPayload(cdcResponseObject);

                var    recordsAffected = 0;
                string entityResponse;

                ServiceResponse = new GenericServiceResponse
                {
                    Success            = true,
                    RestResponseStatus = GenericServiceResponse.RestStatus.Empty
                };

                if (checkIfExists.Any())
                {
                    recordsAffected = await _leadRepository.LeadCreatedSetRecordId(
                        leadPayload._PayloadHeader.CmcCustomerGuidC, leadPayload._PayloadHeader.RecordIdC, logCommand);

                    entityResponse = $"Lead Exists, Update SF-Record-ID, rows added/updated = {recordsAffected}" + Environment.NewLine +
                                     $"Records Expected: 1 ";
                }
                else
                {
                    Guid programGuid;
                    Guid subprogramGuid;
                    Guid lkpLeadStatusGuid;
                    Guid lkpAuditTypeGuid;
                    Guid accountTypeGuid;

                    //Customer Guid Check
                    upsertEventState = "Attempting to check CustomerGuid" + Environment.NewLine;
                    if (leadPayload._PayloadHeader.CmcCustomerGuidC == Guid.Empty)
                    {
                        throw new Exception($"Error: {Service}.{method} -- Missing Customer Guid ");
                    }

                    //ProgramGuid
                    upsertEventState = "Attempting To Get Program Guid" + Environment.NewLine;
                    if (!string.IsNullOrEmpty(leadPayload._PayloadHeader.SalesforceProgramIDC))
                    {
                        var program = await _programRepository.GetProgramFromSFID(leadPayload._PayloadHeader.SalesforceProgramIDC, logCommand);

                        programGuid = program.ProgramGuid;
                    }
                    else
                    {
                        throw new Exception($"Error: {Service}.{method} -- Missing SalesforceProgramID ");
                    }

                    //SubprogramGuid
                    upsertEventState = "Attempting To Get SubProgram Guid" + Environment.NewLine;
                    if (!string.IsNullOrEmpty(leadPayload._PayloadHeader.SalesforceSubProgramIDC))
                    {
                        var subprogram = await _programRepository.GetSubProgramSFID(leadPayload._PayloadHeader.SalesforceSubProgramIDC, logCommand);

                        subprogramGuid = subprogram.SubProgramGuid;
                    }
                    else
                    {
                        subprogramGuid = Guid.Parse("FB02657F-3985-4F06-84C3-1669BE2F2991");
                    }

                    //LKPLeadStatusGuid
                    upsertEventState = "Attempting To Get LKPLeadStatus Guid" + Environment.NewLine;
                    if (!string.IsNullOrEmpty(leadPayload._PayloadBody.Status))
                    {
                        var lkPleadStatus = await _leadRepository.GetLkpLeadStatusFromName(leadPayload._PayloadBody.Status, logCommand);

                        lkpLeadStatusGuid = lkPleadStatus.LeadStatusGuid;
                    }
                    else
                    {
                        logCommand.LogMessage = string.Format($"Error: {Service}.{method} -- Missing LKPLeadStatus ");
                        _logHandler.HandleLog(logCommand);

                        return(ServiceResponse);
                    }

                    //LKPAuditTypeGuid
                    upsertEventState = "Attempting To Get LKPAuditType Guid" + Environment.NewLine;
                    if (!string.IsNullOrEmpty(leadPayload._PayloadBody.AuditTypeC))
                    {
                        var lkpAuditType = await _leadRepository.GetLkpLeadAuditTypeFromName(leadPayload._PayloadBody.AuditTypeC, logCommand);

                        lkpAuditTypeGuid = lkpAuditType.AuditTypeGuid;
                    }
                    else
                    {
                        var lkpAuditType = await _leadRepository.GetLkpLeadAuditTypeFromName("Not Qualified", logCommand);

                        lkpAuditTypeGuid = lkpAuditType.AuditTypeGuid;
                    }

                    //LKPAccountTypeGuid
                    //Todo This is hard coded!!! NotQualify, needs to be fixed.
                    upsertEventState = "Attempting To Get LkpAccountType Guid" + Environment.NewLine;
                    if (!string.IsNullOrEmpty("Commercial"))
                    {
                        var lkpAccountType = await _customerRepository.GetCustomerAccountTypeFromName("Commercial", logCommand);

                        accountTypeGuid = lkpAccountType.AccountTypeGuid;
                    }
                    else
                    {
                        logCommand.LogMessage = string.Format($"Error: {Service}.{method} -- Missing AccountTypeGuid ");
                        _logHandler.HandleLog(logCommand);


                        return(ServiceResponse);
                    }

                    upsertEventState = "Attempting To Instantiate Customer" + Environment.NewLine;
                    var customer = new Customer(leadPayload, programGuid, subprogramGuid, accountTypeGuid);
                    upsertEventState = "Attempting To Instantiate Lead" + Environment.NewLine;
                    var lead = new Lead(leadPayload, lkpLeadStatusGuid, lkpAuditTypeGuid)
                    {
                        LeadStatusChangeDate = DateTime.Now
                    };

                    upsertEventState = "Attempting To Execute on Customer" + Environment.NewLine;
                    recordsAffected += await _customerRepository.InsertCustomer(customer, logCommand);

                    ServiceResponse = await InsertAuditRecordAsync(logCommand, cdcResponseObject, customer.GetType().FullName, leadPayload._PayloadBody.LastModifiedById);

                    if (!ServiceResponse.Success)
                    {
                        return(ServiceResponse);
                    }

                    upsertEventState = "Attempting To Execute on Lead" + Environment.NewLine;
                    recordsAffected += await _leadRepository.InsertLead(lead, logCommand);

                    ServiceResponse = await InsertAuditRecordAsync(logCommand, cdcResponseObject, lead.GetType().FullName, leadPayload._PayloadBody.LastModifiedById);

                    if (!ServiceResponse.Success)
                    {
                        return(ServiceResponse);
                    }

                    upsertEventState = "Attempting To Instantiate Contact" + Environment.NewLine;
                    var primaryContact = new Contact(leadPayload, Guid.Parse("BEF01936-5D80-471D-AF77-4CC2AE5161B4"));
                    recordsAffected += await _contactRepository.InsertContact(primaryContact, logCommand);

                    ServiceResponse = await InsertAuditRecordAsync(logCommand, cdcResponseObject, primaryContact.GetType().FullName, leadPayload._PayloadBody.LastModifiedById);

                    if (!ServiceResponse.Success)
                    {
                        return(ServiceResponse);
                    }

                    upsertEventState = "Attempting To Get Primary Contact" + Environment.NewLine;
                    var primaryContactData = await _contactRepository.GetPrimaryContactFromCustomerGuid(primaryContact.CustomerGuid, logCommand);

                    upsertEventState = "Attempting To Instantiate Phone" + Environment.NewLine;
                    var phone = new PhoneNumbers(leadPayload, primaryContactData.ContactGuid);
                    upsertEventState = "Attempting To Instantiate Email" + Environment.NewLine;
                    var email = new Email(leadPayload, primaryContactData.ContactGuid);

                    upsertEventState = "Attempting To Execute on Phone" + Environment.NewLine;
                    recordsAffected += await _contactRepository.InsertPhone(phone, logCommand);

                    ServiceResponse = await InsertAuditRecordAsync(logCommand, cdcResponseObject, phone.GetType().FullName, leadPayload._PayloadBody.LastModifiedById);

                    if (!ServiceResponse.Success)
                    {
                        return(ServiceResponse);
                    }

                    upsertEventState = "Attempting To Execute on Email" + Environment.NewLine;
                    recordsAffected += await _contactRepository.InsertEmail(email, logCommand);

                    ServiceResponse = await InsertAuditRecordAsync(logCommand, cdcResponseObject, email.GetType().FullName, leadPayload._PayloadBody.LastModifiedById);

                    if (!ServiceResponse.Success)
                    {
                        return(ServiceResponse);
                    }
                    upsertEventState = "Executions Complete" + Environment.NewLine;

                    entityResponse = $"Lead Does Not Exist, Insert Skeleton " + Environment.NewLine +
                                     $"Records Inserted: {recordsAffected} " + Environment.NewLine +
                                     $"Records Expected: 5 ";
                }

                if (recordsAffected == 0)
                {
                    return(ServiceHelper.SetGenericServiceResponseForEntity($"Insert for ObjectName: {cdcResponseObject.ObjectNameC} and RecordId: {cdcResponseObject.RecordIdC} failed."));
                }
                ServiceResponse.Entity             = entityResponse;
                ServiceResponse.Success            = true;
                ServiceResponse.RestResponseStatus = GenericServiceResponse.RestStatus.Success;


                logCommand.LogMessage = string.Format($"{Service}.{method} completed");
                _logHandler.HandleLog(logCommand);

                return(ServiceResponse);
            }
            catch (Exception ex)
            {
                ex.Data.Add("Point of Failure", upsertEventState);
                AppLogger.LogException(_loggingInstance, ex.Message, ex);
                return(ServiceHelper.SetErrorGenericServiceResponse(ex));
            }
        }
        public async Task <GenericServiceResponse> UpdateLeadFromUpdateEvent(PayloadParent payloadResponse, LogCommand logCommand)
        {
            const string method           = "UpdateLeadFromUpdateEvent";
            var          updateEventState = string.Empty;

            try
            {
                logCommand.LogMessage = $"{Service}.{method} Starting input parameter PayloadResponse = {payloadResponse}";
                _logHandler.HandleLog(logCommand);


                var leadPayload = new LeadPayload(payloadResponse);

                logCommand.LogMessage = $"{Service}.{method} Starting input parameter LeadPayload = {leadPayload}";
                _logHandler.HandleLog(logCommand);
                var recordsAffected = 0;

                var existingLeadEnumerable = await _leadRepository.GetLeadByCustomerGuidAsync(leadPayload._PayloadHeader.CmcCustomerGuidC, logCommand);

                var existingLeadList = existingLeadEnumerable.ToList();
                if (!existingLeadList.Any())
                {
                    throw new Exception($"Attempting to update Lead where CustomerGuid =  {leadPayload._PayloadHeader.CmcCustomerGuidC} but lead was not found ");
                }
                var existingLead = existingLeadList[0];

                Guid programGuid;
                Guid subprogramGuid;
                Guid lkpLeadStatusGuid;
                Guid lkpAuditTypeGuid;
                Guid accountTypeGuid;

                //Customer Guid Check
                updateEventState = "Attempting to check CustomerGuid" + Environment.NewLine;
                if (leadPayload._PayloadHeader.CmcCustomerGuidC == Guid.Empty)
                {
                    throw new Exception($"Error: {Service}.{method} -- Missing Customer Guid ");
                }

                //ProgramGuid
                updateEventState = "Attempting To Get Program Guid" + Environment.NewLine;
                if (!string.IsNullOrEmpty(leadPayload._PayloadHeader.SalesforceProgramIDC))
                {
                    var program = await _programRepository.GetProgramFromSFID(leadPayload._PayloadHeader.SalesforceProgramIDC, logCommand);

                    programGuid = program.ProgramGuid;
                }
                else
                {
                    throw new Exception($"Error: {Service}.{method} -- Missing SalesforceProgramID ");
                }

                //SubprogramGuid
                updateEventState = "Attempting To Get SubProgram Guid" + Environment.NewLine;
                if (!string.IsNullOrEmpty(leadPayload._PayloadHeader.SalesforceSubProgramIDC))
                {
                    var subprogram = await _programRepository.GetSubProgramSFID(leadPayload._PayloadHeader.SalesforceSubProgramIDC, logCommand);

                    subprogramGuid = subprogram.SubProgramGuid;
                }
                else
                {
                    subprogramGuid = Guid.Parse("FB02657F-3985-4F06-84C3-1669BE2F2991");
                }

                //LKPLeadStatusGuid
                updateEventState = "Attempting To Get LKPLeadStatus Guid" + Environment.NewLine;
                if (!string.IsNullOrEmpty(leadPayload._PayloadBody.Status))
                {
                    var lkPleadStatus = await _leadRepository.GetLkpLeadStatusFromName(leadPayload._PayloadBody.Status, logCommand);

                    lkpLeadStatusGuid = lkPleadStatus.LeadStatusGuid;
                }
                else
                {
                    throw new Exception($"Error: {Service}.{method} -- Missing LKPLeadStatus ");
                }

                //LKPAuditTypeGuid
                updateEventState = "Attempting To Get LKPAuditType Guid" + Environment.NewLine;
                if (!string.IsNullOrEmpty(leadPayload._PayloadBody.AuditTypeC))
                {
                    var lkpAuditType = await _leadRepository.GetLkpLeadAuditTypeFromName(leadPayload._PayloadBody.AuditTypeC, logCommand);

                    lkpAuditTypeGuid = lkpAuditType.AuditTypeGuid;
                }
                else
                {
                    throw new Exception($"Error: {Service}.{method} -- Missing LKPAuditType ");
                }

                updateEventState = "Attempting To Instantiate customer" + Environment.NewLine;
                var customer = new Customer(leadPayload, programGuid, subprogramGuid, accountTypeGuid);

                //Get Primary Contact Guid
                updateEventState = "Attempting To Instantiate primaryContact" + Environment.NewLine;
                var primaryContact = new Contact(leadPayload, Guid.Parse("BEF01936-5D80-471D-AF77-4CC2AE5161B4"));
                //primaryContact.CustomerGuid = Guid.Parse("A30FD8B1-9BE2-47FB-8D9E-AC8EFCEFE369");

                updateEventState = "Attempting To Get Primary Contact" + Environment.NewLine;
                var primaryContactData = await _contactRepository.GetPrimaryContactFromCustomerGuid(leadPayload._PayloadHeader.CmcCustomerGuidC, logCommand);


                //Customer
                updateEventState = "Attempting To Execute on Customer" + Environment.NewLine;
                recordsAffected += await _customerRepository.UpdateCustomer(customer, logCommand);

                ServiceResponse = await InsertAuditRecordAsync(logCommand, payloadResponse, customer.GetType().FullName, leadPayload._PayloadBody.LastModifiedById);

                if (!ServiceResponse.Success)
                {
                    return(ServiceResponse);
                }

                //Lead
                updateEventState = "Attempting To Instantiate lead" + Environment.NewLine;
                var lead = new Lead(leadPayload, lkpLeadStatusGuid, lkpAuditTypeGuid);

                //Update Lead Status Change Date timestamp if lead status changed
                if (existingLead.LeadStatusGuid == lead.LeadStatusGuid)
                {
                    if (lead.LeadStatusChangeDate == null)
                    {
                        lead.LeadStatusChangeDate = Convert.ToDateTime("1900-01-01");
                    }
                }
                else
                {
                    lead.LeadStatusChangeDate = DateTime.Now.Date;
                }

                //Set ReserveDate to Today.23:59.59 if reservation is done by SF.  See GetPrioLeads which sets
                //Reservation for leads to now + 15 minutes as a way to send different sets of leads to CSR's
                //that are looking for leads with similar criteria
                if (lead.ReservedDate == DateTime.Today)
                {
                    lead.ReservedDate = DateTime.Today.AddHours(23).AddMinutes(59).AddSeconds(59);
                }

                updateEventState = "Attempting To Execute on Lead" + Environment.NewLine;
                recordsAffected += await _leadRepository.UpdateLeadAsync(lead, logCommand);

                ServiceResponse = await InsertAuditRecordAsync(logCommand, payloadResponse, lead.GetType().FullName, leadPayload._PayloadBody.LastModifiedById);

                if (!ServiceResponse.Success)
                {
                    return(ServiceResponse);
                }

                //Update Primary Contact
                updateEventState = "Attempting To Execute on Primary Contact" + Environment.NewLine;
                recordsAffected += await _contactRepository.UpdatePrimaryContact(primaryContact, logCommand);

                ServiceResponse = await InsertAuditRecordAsync(logCommand, payloadResponse, primaryContact.GetType().FullName, leadPayload._PayloadBody.LastModifiedById);

                if (!ServiceResponse.Success)
                {
                    return(ServiceResponse);
                }

                //Phone and Email
                updateEventState = "Attempting To Instantiate Phone and Email Objects" + Environment.NewLine;
                var phone = new PhoneNumbers(leadPayload, primaryContactData.ContactGuid);
                var email = new Email(leadPayload, primaryContactData.ContactGuid);

                updateEventState = "Attempting To Execute on Phone" + Environment.NewLine;
                recordsAffected += await _contactRepository.UpdatePhone(phone, logCommand);

                ServiceResponse = await InsertAuditRecordAsync(logCommand, payloadResponse, phone.GetType().FullName, leadPayload._PayloadBody.LastModifiedById);

                if (!ServiceResponse.Success)
                {
                    return(ServiceResponse);
                }

                updateEventState = "Attempting To Execute on Email" + Environment.NewLine;
                recordsAffected += await _contactRepository.UpdateEmail(email, logCommand);

                ServiceResponse = await InsertAuditRecordAsync(logCommand, payloadResponse, email.GetType().FullName, leadPayload._PayloadBody.LastModifiedById);

                if (!ServiceResponse.Success)
                {
                    return(ServiceResponse);
                }

                updateEventState = "Executions Complete" + Environment.NewLine;


                ServiceResponse = new GenericServiceResponse
                {
                    Entity             = $"Update Lead Related Tables Successful, rows added/updated = {recordsAffected}",
                    Success            = true,
                    RestResponseStatus = GenericServiceResponse.RestStatus.Success
                };

                logCommand.LogMessage = string.Format($"{Service}.{method} completed");
                _logHandler.HandleLog(logCommand);

                return(ServiceResponse);
            }
            catch (Exception ex)
            {
                ex.Data.Add("Point of Failure", updateEventState);
                AppLogger.LogException(_loggingInstance, ex.Message, ex);
                return(ServiceHelper.SetErrorGenericServiceResponse(ex));
            }
        }