Exemple #1
0
        public static LeadTargetType MapToLeadTargetType(this InquiryType inquiry)
        {
            switch (inquiry)
            {
            case InquiryType.Community:
            {
                return(LeadTargetType.Community);
            }

            case InquiryType.ServiceProvider:
            {
                return(LeadTargetType.ServiceProvider);
            }

            case InquiryType.FloorPlan:
            {
                return(LeadTargetType.Community);
            }

            case InquiryType.SpecialHome:
            {
                return(LeadTargetType.Community);
            }

            case InquiryType.Home:
            {
                return(LeadTargetType.Community);
            }
            }
            throw new ArgumentOutOfRangeException("inquiry");
        }
        public InqueryHistory(string id, InquiryType inquiryType, string messagePlainText, string message, string subject,
                              string agentEmail, AgentInfo agentInfo, AgentInquiryInfo agentInquiryInfo,
                              AgentAutoresponderTemplateInfo agentAutoresponderTemplateInfo, OrganizationInfo organizationInfo)
            : this()
        {
            Id = id;
            //OrganizationEmail = organizationEmail;
            //Organization = organizationEmail?.Split("@")[1];
            Message          = message;
            MessagePlainText = messagePlainText;
            Subject          = subject;
            AgentEmail       = agentEmail;
            AgentInfo        = agentInfo;
            InquiryType      = inquiryType;

            OrganizationInfo = organizationInfo;
            AgentInquiryInfo = agentInquiryInfo;
            AgentAutoresponderTemplateInfo = agentAutoresponderTemplateInfo;

            CreatedDate = DateTime.UtcNow;
            UpdatedDate = DateTime.UtcNow;

            var inqueryHistoryStartedDomainEvent = new InqueryHistoryStartedDomainEvent
            {
                InqueryHistory = this
            };

            this.AddDomainEvent(inqueryHistoryStartedDomainEvent);
        }
Exemple #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Code,NameInquiry")] InquiryType inquiryType)
        {
            if (id != inquiryType.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(inquiryType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InquiryTypeExists(inquiryType.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(inquiryType));
        }
Exemple #4
0
 public static LeadPageType ToLegacyLeadPageType(this InquiryType inquiry)
 {
     if (inquiry == InquiryType.ServiceProvider)
     {
         return(LeadPageType.ServiceDetails);
     }
     return(LeadPageType.PropertyDetails);
 }
Exemple #5
0
 public string CreateMessage(InquiryType inquiryType, DetailType detailType, string cprNumber)
 {
     return(string.Format("{0}{1}{2}",
                          (int)inquiryType,
                          (int)detailType,
                          cprNumber
                          ));
 }
Exemple #6
0
        public void CreateTypeform(InquiryType typeFormType)
        {
            var agentTypeformUpdatedEvent = new AgentTypeformCreatedEvent()
            {
                Agent        = this,
                TypeFormType = typeFormType
            };

            this.AddDomainEvent(agentTypeformUpdatedEvent);
        }
Exemple #7
0
        public void CreateSpreadsheet(InquiryType typeFormType)
        {
            var agentSpreadsheetCreatedEvent = new AgentSpreadsheetCreatedEvent()
            {
                Agent        = this,
                TypeFormType = typeFormType
            };

            this.AddDomainEvent(agentSpreadsheetCreatedEvent);
        }
Exemple #8
0
        public async Task <IActionResult> Create([Bind("Id,Code,NameInquiry")] InquiryType inquiryType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(inquiryType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(inquiryType));
        }
Exemple #9
0
        public static Inquiry New(DateTime date, Company subcriptor, InquiryType inquiryType, Person person)
        {
            var inquiry = new Inquiry
            {
                Date        = date,
                Subcriptor  = subcriptor,
                InquiryType = inquiryType,
                Person      = person,
            };

            return(inquiry);
        }
        private async Task <string> CreateTypeFormUrl(Agent agent, InquiryType typeformType, string typeFormTemplateJson)
        {
            Regex reg = new Regex(@"(\""title\"":[ ]?\"")([\d\s\w]*)");

            typeFormTemplateJson = reg.Replace(typeFormTemplateJson, delegate(Match m)
            {
                return(m.Groups[1].Value + agent.GetTypeformName(Enum.GetName(typeof(InquiryType), typeformType)));
            }, 1);

            var cretedTypeFormJson = await typeForm.CreateTypeFormAsync(typeFormTemplateJson);

            dynamic cretedTypeForm = JObject.Parse(cretedTypeFormJson);

            return(cretedTypeForm._links.display);
        }
        public async Task <ClientResponse> InquiryAsync(InquiryType inquiry, string traceNumber = null)
        {
            var item    = inquiry.CopyToBase();
            var xmlBody = new Request {
                Item = item
            };
            var url     = Endpoint.Url();
            var request = new ClientRequest
            {
                Request     = xmlBody,
                TraceNumber = traceNumber,
            };

            return(await SendRequestAsync(url, request));
        }
Exemple #12
0
        public static LeadEventType ToLeadEventType(this InquiryType inquiry)
        {
            switch (inquiry)
            {
            case InquiryType.Community:
            case InquiryType.ServiceProvider:
            {
                return(LeadEventType.GetMoreInformation);
            }

            case InquiryType.FloorPlan:
            {
                return(LeadEventType.FloorPlanCheckAvailability);
            }

            case InquiryType.SpecialHome:
            case InquiryType.Home:
            {
                return(LeadEventType.SpecHomeCheckAvailability);
            }
            }
            throw new ArgumentOutOfRangeException();
        }
Exemple #13
0
 public ClientResponse Inquiry(InquiryType inquiry, string traceNumber = null)
 {
     return(_client.Inquiry(inquiry, traceNumber));
 }
Exemple #14
0
 public async Task <ClientResponse> InquiryAsync(InquiryType inquiry, string traceNumber = null)
 {
     return(await _client.InquiryAsync(inquiry, traceNumber));
 }
Exemple #15
0
 public AuthorizationBuilder BalanceInquiry(InquiryType type = InquiryType.FOODSTAMP)
 {
     return(new AuthorizationBuilder(TransactionType.Balance).WithBalanceInquiryType(type).WithAmount(0m));
 }
Exemple #16
0
        public string CallDiversion(InquiryType inquiryType, DetailType detailType, string cprNumber)
        {
            string message = CreateMessage(inquiryType, detailType, cprNumber);

            return(Send(message, cprNumber));
        }
 public ClientResponse Inquiry(InquiryType inquiry, string traceNumber = null)
 {
     return(InquiryAsync(inquiry, traceNumber).GetAwaiter().GetResult());
 }
Exemple #18
0
        public AgentInquiry(InquiryType inquiryType)
        {
            this.InquiryType = inquiryType;

            this.InquiryAutoresponderTemplate = new AgentAutoresponderTemplate();
        }
        private Spreadsheet CreateSpreadsheetForTrackingInquiry(Agent agent, List <string> fields, InquiryType typeFormType)
        {
            CreateSpreadsheetCommand createSpreadsheetCommand = new CreateSpreadsheetCommand
            {
                SpreadSheetName = agent.GetSpreadsheetName(Enum.GetName(typeof(InquiryType), typeFormType)),
                WorkSheetName   = Enum.GetName(typeof(InquiryType), typeFormType),
                ApplicationName = "LeadsPlus"
            };

            foreach (var item in fields)
            {
                createSpreadsheetCommand.HeaderValues.Add(item);
                createSpreadsheetCommand.InitialValues.Add("test"); // this is required for Zapier to function correctly
            }

            var spreadsheet = mediator.Send(createSpreadsheetCommand).Result;

            //no longer necessary. we will create a sharable link and share.

            //AssigSpreadsheetPermissionCommand assigSpreadsheetPermissionCommand = new AssigSpreadsheetPermissionCommand
            //{
            //    Email = agent.Email,
            //    SpreadsheetId = spreadsheet.SpreadsheetId,
            //    ApplicationName = "LeadsPlus"
            //};

            //var assigSpreadsheetPermissionCommandResult = mediator.Send(assigSpreadsheetPermissionCommand).Result;

            AssigSpreadsheetPermissionCommand assigSpreadsheetPermissionToOrganizationCommand = new AssigSpreadsheetPermissionCommand
            {
                Email           = "*****@*****.**",
                SpreadsheetId   = spreadsheet.SpreadsheetId,
                ApplicationName = "LeadsPlus"
            };

            var assigSpreadsheetPermissionToOrganizationCommandResult = mediator.Send(assigSpreadsheetPermissionToOrganizationCommand).Result;

            //var createContactIntegrationEvent = new CreateContactIntegrationEvent()
            //{
            //    AggregateId = agent.Id,
            //    Source = "AdfenixLeads",
            //    Email = agent.Email,
            //    OwnerId = agent.Id,
            //    Ownername = $"{agent.Firstname} {agent.Lastname}"
            //};

            //eventBus.Publish(createContactIntegrationEvent);

            return(spreadsheet);
        }