Skip to content

Commit

Permalink
Added cleaner to the build queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Lovro Biljeskovic committed Oct 25, 2019
1 parent e06c60b commit cca9c19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/VatLayerExternalSearchProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using CluedIn.Core.Data.Parts;
using CluedIn.Core.ExternalSearch;
using CluedIn.ExternalSearch.Providers.VatLayer.Models;
using CluedIn.ExternalSearch.Providers.VatLayer.Utility;
using CluedIn.ExternalSearch.Providers.VatLayer.Vocabularies;
using Newtonsoft.Json;
using RestSharp;
Expand Down Expand Up @@ -78,9 +79,9 @@ public override IEnumerable<IExternalSearchQuery> BuildQueries(ExecutionContext

foreach (var value in vatNumber.Where(v => !vatFilter(v)))
{
var sanitizedValue = value.Replace(" ", "");
var cleaner = new VatNumberCleaner();
var sanitizedValue = cleaner.CheckVATNumber(value);
//yield return new ExternalSearchQuery(this, entityType, ExternalSearchQueryParameter.Identifier, value);
if (Regex.IsMatch(sanitizedValue.ToUpper(), @"[A-Z]{2}\d+"))
yield return new ExternalSearchQuery(this, entityType, ExternalSearchQueryParameter.Identifier, sanitizedValue);
}
}
Expand Down

0 comments on commit cca9c19

Please sign in to comment.