private Dictionary <string, string> GetMergeField(Domain.Agent agent)
        {
            var mergedFields = new Dictionary <string, string>()
            {
                { "[agentfirstname]", agent.Firstname },
                { "[agentlastname]", agent.Lastname },
                { "[agentaddress]", agent.Address },
                { "[agentcity]", agent.City },
                { "[agentstate]", agent.State },
                { "[agentzip]", agent.Zip },
                { "[agentfacebook]", agent.Facebook },
                { "[agentinstagram]", agent.Instagram },
                { "[agenttwitter]", agent.Twitter },
                { "[agentlinkedIn]", agent.LinkedIn },
                { "[agentlogo]", agent.Logo },
                { "[agentbuyinquirytypeformlink]", agent.BuyInquiry.TypeFormUrl },
                { "[agentbuyinquiryspreadsheetlink]", agent.BuyInquiry.SpreadsheetShareableUrl },
                { "[agentmortgagespreadsheetlink]", agent.AgentSpreadsheet.MortgageSpreadsheetShareableUrl },
                { "[agentrentinquirytypeformlink]", agent.RentInquiry.TypeFormUrl },
                { "[agentrentinquiryspreadsheetlink]", agent.RentInquiry.SpreadsheetShareableUrl },
                { "[agentlandlordspreadsheetlink]", agent.AgentSpreadsheet.LandlordSpreadsheetShareableUrl },
                { "[agentVendorspreadsheetlink]", agent.AgentSpreadsheet.VendorSpreadsheetShareableUrl }
            };

            return(mergedFields);
        }
Пример #2
0
 protected override void When()
 {
     Agent = new Domain.Agent(Bus, Worker, url => Repo, new string[]{}, Guid.NewGuid());
     Agent.JoinTheParty();
     buildMessage1 = new Build { RepoUrl = "http://fle", Revision = new RevisionInfo { Revision = "2" } };
     Agent.Handle(buildMessage1);
     buildMessage2 = new Build { RepoUrl = "http://flo", Revision = new RevisionInfo { Revision = "2" } };
     Agent.Handle(buildMessage2);
 }
Пример #3
0
 protected override void Given()
 {
     base.Given();
     var WorkerWithEvents = Worker;
     Worker = Substitute.For<Worker>(null,null);
     Worker.When(
         worker => worker.ExecutePipelineForRevision(Arg.Any<SourceRepoDriver>(), Arg.Is("2"))).Do(
             info => { throw new ApplicationException(); });
     Worker.When(
         worker => worker.ExecutePipelineForRevision(Arg.Any<SourceRepoDriver>(), Arg.Is("3"))).Do(
             callInfo => WorkerWithEvents.ExecutePipelineForRevision(null,null));
     Agent = new Domain.Agent(Bus, Worker, url => null, new string[] { }, Guid.NewGuid());
     try
     {
         Agent.Handle(new Build { RepoUrl = "asda", Revision = new RevisionInfo { Revision = "2" } });
     } catch(ApplicationException)
     {
     }
 }
        private async Task <bool> CreateAggregateSpreadsheet(Domain.Agent agent)
        {
            var spreadsheet = CreateSpreadsheetForTrackingInquiry(agent, inquiryAggrigateHeaders.ToList(), InquiryType.Aggregate);

            agent.AgentSpreadsheet.AggregateSpreadsheetUrl          = spreadsheet.SpreadsheetUrl;
            agent.AgentSpreadsheet.AggregateSpreadsheetShareableUrl = spreadsheet.SpreadsheetUrl;
            agent.AgentSpreadsheet.AggregateSpreadsheetId           = spreadsheet.SpreadsheetId;
            agent.AgentSpreadsheet.AggregateSpreadsheetName         = agent.GetSpreadsheetName(Enum.GetName(typeof(InquiryType), InquiryType.Aggregate));

            var filter = Builders <Agent> .Filter.Eq("Id", agent.Id);

            var update = Builders <Agent> .Update
                         .Set("AgentSpreadsheet", agent.AgentSpreadsheet)
                         .CurrentDate("UpdatedDate");

            await agentRepository.Collection
            .UpdateOneAsync(filter, update, new UpdateOptions { IsUpsert = true });

            agent.CreateSpreadsheet(InquiryType.Aggregate);
            await mediator.DispatchDomainEventsAsync(agent);

            return(true);
        }
Пример #5
0
 protected override void When()
 {
     agentId = Guid.NewGuid();
     Agent = new Domain.Agent(Bus, Worker, url => Repo, new string[] { }, agentId);
     Agent.JoinTheParty();
 }