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; } }
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]); } }
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); }
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(); }
protected IList <IPositionedPipelineElement <T> > GroupElements(IList <IPositionedPipelineElement <T> > elements, PipelinePosition position) { return(elements.Where(e => e.Position == position)?.ToArray()); }
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; } }
public List<PropertySummary> GetPropertySummariesForAreaAndStatus(List<string> areas, PipelinePosition pipelinePosition, Ordering order, Page page) { return GetPropertyForAreaAndStatus(areas, pipelinePosition, order, page) .Select(SearchResultFactory.BuildPropertySummary) .ToList(); }
public List<CaselistEntry> GetPropertyCaselistEntryForAreaAndStatus(List<string> areas, PipelinePosition pipelinePosition, Ordering order, Page page) { return GetPropertyForAreaAndStatus(areas,pipelinePosition,order,page) .Select(CaselistEntryFactory.BuildCaselistEntry) .ToList(); }
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; }
public static IEnumerable<Application> FilterByPipelinePosition(this IEnumerable<Application> applications, PipelinePosition pipelinePosition) { return applications.Where(a => a.PipelinePosition == pipelinePosition); }