public AbstractLeadProcessor(int leadNumber, AmoAccount acc, ProcessQueue processQueue, Log log, CancellationToken token) { _leadRepo = acc.GetRepo <Lead>(); _processQueue = processQueue; _token = token; _acc = acc; _leadNumber = leadNumber; _log = log; custom_fields_values = new(); tags = new(); try { Thread.Sleep((int)TimeSpan.FromSeconds(3).TotalMilliseconds); lead = _leadRepo.GetById(leadNumber); if (lead is not null && lead._embedded is not null && lead._embedded.tags is not null) { tags = lead._embedded.tags; } } catch (Exception e) { _processQueue.Stop(leadNumber.ToString()); _processQueue.Remove(leadNumber.ToString()); _log.Add($"Error: Unable to create leadProcessor {leadNumber}: {e.Message}"); } }
public SmilarcompaniesCheckProcessor(int companyNumber, AmoAccount acc, ProcessQueue processQueue, Log log, CancellationToken token, RecentlyUpdatedEntityFilter filter) { _companyNumber = companyNumber; _compRepo = acc.GetRepo <Company>(); _token = token; _log = log; _filter = filter; _processQueue = processQueue; }
public AbstractLeadProcessor(AmoAccount acc, ProcessQueue processQueue, Log log, CancellationToken token) { _leadRepo = acc.GetRepo <Lead>(); _processQueue = processQueue; _token = token; _acc = acc; _log = log; custom_fields_values = new(); tags = new(); }
public PPIELeadsProcessor(int leadNumber, AmoAccount acc, ProcessQueue processQueue, Log log, CancellationToken token) { _leadRepo = acc.GetRepo <Lead>(); _processQueue = processQueue; _token = token; _leadNumber = leadNumber; _log = log; try { Thread.Sleep((int)TimeSpan.FromSeconds(3).TotalMilliseconds); lead = _leadRepo.GetById(leadNumber); } catch (Exception e) { _processQueue.Stop(leadNumber.ToString()); _processQueue.Remove(leadNumber.ToString()); _log.Add($"Error: Unable to create leadProcessor {leadNumber}: {e.Message}"); } }
protected void ProcessInstaName() { if (lead._embedded is not null && lead._embedded.contacts is not null) { var contRepo = _acc.GetRepo <Contact>(); var contact = contRepo.GetById((int)lead._embedded.contacts.First().id); if (contact.HasCF(640695)) { var instaWZ = contact.GetCFStringValue(640695); contRepo.AddNotes(new Note() { entity_id = contact.id, note_type = "common", parameters = new Note.Params() { text = $"https://www.instagram.com/{instaWZ.Replace("@", "").Trim()}/" } }); } } }