-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VCST-204: Filter in Orders blade doesn't work with indexing search (#398
) fix: Filter in Orders blade doesn't work with indexing search (#398)
- Loading branch information
Showing
7 changed files
with
125 additions
and
7 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
src/VirtoCommerce.OrdersModule.Core/Model/Search/CustomerOrderIndexedSearchCriteria.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/VirtoCommerce.OrdersModule.Data/Search/Indexed/FilterHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using VirtoCommerce.SearchModule.Core.Model; | ||
|
||
namespace VirtoCommerce.OrdersModule.Data.Search.Indexed | ||
{ | ||
public static class FilterHelper | ||
{ | ||
public static IFilter CreateTermFilter(string fieldName, string value) | ||
{ | ||
return new TermFilter | ||
{ | ||
FieldName = fieldName, | ||
Values = new[] { value }, | ||
}; | ||
} | ||
|
||
public static IFilter CreateTermFilter(string fieldName, IEnumerable<string> values) | ||
{ | ||
return new TermFilter | ||
{ | ||
FieldName = fieldName, | ||
Values = values.ToArray(), | ||
}; | ||
} | ||
|
||
public static IFilter CreateDateRangeFilter(string fieldName, DateTime? lower, DateTime? upper, bool includeLower, bool includeUpper) | ||
{ | ||
return CreateRangeFilter(fieldName, lower?.ToString("O"), upper?.ToString("O"), includeLower, includeUpper); | ||
} | ||
|
||
public static IFilter CreateRangeFilter(string fieldName, string lower, string upper, bool includeLower, bool includeUpper) | ||
{ | ||
return new RangeFilter | ||
{ | ||
FieldName = fieldName, | ||
Values = new[] { CreateRangeFilterValue(lower, upper, includeLower, includeUpper) }, | ||
}; | ||
} | ||
|
||
public static RangeFilterValue CreateRangeFilterValue(string lower, string upper, bool includeLower, bool includeUpper) | ||
{ | ||
return new RangeFilterValue | ||
{ | ||
Lower = lower, | ||
Upper = upper, | ||
IncludeLower = includeLower, | ||
IncludeUpper = includeUpper, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters