コード例 #1
0
 public static string ParsePipelinePosition(PipelinePosition position)
 {
     switch (position)
     {
         case PipelinePosition.Unknown:
             return "Unknown";
         case PipelinePosition.ApplicantComplete:
             return "Applicant Complete";
         case PipelinePosition.GuarantorComplete:
             return "Guarantor Complete";
         case PipelinePosition.Approved:
             return "Approved";
         case PipelinePosition.InProgress:
             return "In Progress";
         case PipelinePosition.Let:
             return "Let";
         case PipelinePosition.Cancelled:
             return "Cancelled";
         case PipelinePosition.Archived:
             return "Archived";
         case PipelinePosition.Interested:
             return "Interested";
         case PipelinePosition.Viewing:
             return "Viewing";
         case PipelinePosition.AwaitingViewing:
             return "Awaiting Viewing";
         case PipelinePosition.TenancyEnding:
             return "Tenancy Ending";
         case PipelinePosition.TenancyEnded:
             return "Tenancy Ended";
         default:
             return string.Empty;
     }
 }
コード例 #2
0
        public void Should_put_nodes_in_position(string key, PipelinePosition keyPosition, string[] expectedOrder)
        {
            Action <string, string, string[]> add = (k, v, d) =>
                                                    _dependencyGraph.Add(
                k,
                v,
                d == null ? null : d.Select(dk => new DependencyGraphEdge {
                Key = dk
            }),
                k == key ? keyPosition : PipelinePosition.Middle);

            add("1", "One", new[] { "2" });
            add("2", "Two", new[] { "3" });
            add("3", "Three", new[] { "5" });
            add("4", "Four", new[] { "5" });
            add("5", "Five", new[] { "6" });
            add("6", "Six", null);

            var buildOrder = _dependencyGraph.GetBuildOrderKeys().ToList();

            Assert.AreEqual(6, buildOrder.Count, "number of items in the build order");

            for (var i = 0; i < expectedOrder.Length; i++)
            {
                Assert.AreEqual(expectedOrder[i], buildOrder[i]);
            }
        }
コード例 #3
0
        private IEnumerable<Property> GetPropertyForAreaAndStatus(List<string> areas, PipelinePosition pipelinePosition, Ordering order, Page page)
        {
            Check.If(areas).IsNotNull();
            Check.If(areas).IsNotEmpty();

            var properties = _propertyRepository.GetPropertiesByAreas(areas, Ordering.Newest).ToList();

            if (properties.IsNull() || properties.IsEmpty())
                return new List<Property>();

            foreach (var property in properties)
            {
                property.PipelinePosition = property.PropertyStatus == Status.Let
                    ? PipelinePosition.Let
                    : PipelinePosition.Available;
            }

            return properties
                .Where(p => p.PipelinePosition == pipelinePosition)
                .Skip(page.StartingIndex())
                .Take(page.PageSize);
        }
コード例 #4
0
        public List<CaselistEntry> GetApplicationsForAreaAndStatus(List<string> areas, PipelinePosition pipelinePosition, Ordering order, Page page)
        {
            Check.If(areas).IsNotNull();
            Check.If(areas).IsNotEmpty();

            var applications = _applicationRepository.GetApplicationsForAreas(areas, order);

            if (applications.IsNull() || applications.IsEmpty())
                return new List<CaselistEntry>();

            foreach (var application in applications)
            {
                application.GeneratePipelinePosition(_pipelinePositionGenerator);
            }

            return applications.FilterUnknownApplications()
                .FilterByPipelinePosition(pipelinePosition)
                .InWindow(_caselistWindowSettings)
                .Skip(page.StartingIndex())
                .Take(page.PageSize)
                .Select(CaselistEntryFactory.BuildCaselistEntry)
                .ToList();
        }
コード例 #5
0
 protected IList <IPositionedPipelineElement <T> > GroupElements(IList <IPositionedPipelineElement <T> > elements, PipelinePosition position)
 {
     return(elements.Where(e => e.Position == position)?.ToArray());
 }
コード例 #6
0
 public static string ParsePipelinePosition(PipelinePosition pipelinePosition)
 {
     switch (pipelinePosition)
     {
         case PipelinePosition.Unknown:
             return "Unknown";
         case PipelinePosition.Available:
             return "Available";
         case PipelinePosition.InProgress:
             return "In Progress";
         case PipelinePosition.Let:
             return "Let";
         default:
             return string.Empty;
     }
 }
コード例 #7
0
 public List<PropertySummary> GetPropertySummariesForAreaAndStatus(List<string> areas, PipelinePosition pipelinePosition, Ordering order, Page page)
 {
     return GetPropertyForAreaAndStatus(areas, pipelinePosition, order, page)
         .Select(SearchResultFactory.BuildPropertySummary)
         .ToList();
 }
コード例 #8
0
 public List<CaselistEntry> GetPropertyCaselistEntryForAreaAndStatus(List<string> areas, PipelinePosition pipelinePosition, Ordering order, Page page)
 {
     return GetPropertyForAreaAndStatus(areas,pipelinePosition,order,page)
         .Select(CaselistEntryFactory.BuildCaselistEntry)
         .ToList();
 }
コード例 #9
0
        public void Add(string key, T data, IEnumerable <IDependencyGraphEdge> edges, PipelinePosition position)
        {
            GraphNode graphNode;

            if (_nodeIndex.TryGetValue(key, out graphNode))
            {
                throw new DuplicateKeyException("The key " + key + " has already been added to this dependency graph");
            }

            graphNode = new GraphNode
            {
                Data         = data,
                Key          = key,
                Dependencies = edges == null ? new List <IDependencyGraphEdge>() : edges.ToList(),
                Position     = position
            };
            _nodeIndex.Add(key, graphNode);

            _graphBuilt = false;
        }
コード例 #10
0
 public static IEnumerable<Application> FilterByPipelinePosition(this IEnumerable<Application> applications, PipelinePosition pipelinePosition)
 {
     return applications.Where(a => a.PipelinePosition == pipelinePosition);
 }