Skip to content

Commit

Permalink
Considering partial matches in the project name
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Elosegui committed Jul 10, 2020
1 parent 39be32b commit ac55de2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Milamation/ValidationRules/NeedPBIRule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using HarvestClient.Model;
using System.Linq;

namespace Milamation.ValidationRules
{
Expand All @@ -12,7 +13,7 @@ public override string Validate(TimesheetEntry timesheetEntry)
&& !timesheetEntry.HasPBI
&& (
TasksRequiringPBI.Contains(timesheetEntry.Task?.Name)
&& ProjectsRequiringPBI.Contains(timesheetEntry.Project?.Name)
&& ProjectsRequiringPBI.Any(p => timesheetEntry.Project?.Name.StartsWith(p) == true)
)
)
{
Expand Down
1 change: 1 addition & 0 deletions Milamation/ValidationRules/Rule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public abstract class Rule

public virtual List<string> TasksRequiringPBI => new List<string>()
{
{ "Infrastructure" },
{ "Software Development" },
{ "QA" },
{ "UX Design" },
Expand Down

0 comments on commit ac55de2

Please sign in to comment.