Skip to content

SearchProductsRequest

// RB2 Core Connect
using HotChocolate;
namespace CoreConnect.Commerce.Catalog;
public class SearchProductsRequest
{
/// <summary>
/// The text string on which to search, for example: "Sofa" or "Bed".
/// </summary>
public string? Text { get; set; }
/// <summary>
/// The list of product ids.
/// </summary>
public string[]? ProductIds { get; set; }
/// <summary>
/// The list of product types
/// </summary>
public string[]? ProductTypes { get; set; }
/// <summary>
/// The list of product keys.
/// </summary>
public string[]? ProductKeys { get; set; }
/// <summary>
/// The list of product slugs.
/// </summary>
public string[]? ProductSlugs { get; set; }
/// <summary>
/// Gets or sets the product category ids.
/// </summary>
[GraphQLIgnore]
public string[]? ProductCategoryIds { get; set; }
/// <summary>
/// Gets or sets the product category keys.
/// </summary>
public string[]? ProductCategoryKeys { get; set; }
/// <summary>
/// Gets or sets the product category slugs.
/// </summary>
public string[]? ProductCategorySlugs { get; set; }
/// <summary>
/// Gets or sets the facets.
/// </summary>
public IEnumerable<string>? Facets { get; set; }
/// <summary>
/// Gets or sets the filters.
/// </summary>
public IEnumerable<AvailableFilters>? Filters { get; set; }
/// <summary>
/// Gets or sets the filters exclusion.
/// </summary>
public IEnumerable<AvailableFilters>? FiltersNot { get; set; }
/// <summary>
/// Gets or sets the sortings.
/// </summary>
public IEnumerable<Sorting>? Sortings { get; set; }
/// <summary>
/// Get or sets if the filters must be used to filter the variants
/// </summary>
public bool? HaveVariantFilter { get; set; }
/// <summary>
/// The maximum number of records to retrieve.
/// </summary>
public int? Limit { get; set; }
/// <summary>
/// By specifying offset, you retrieve a subset of records starting with the offset.
/// </summary>
public int? Offset { get; set; }
public bool? IncludeFilterOptions { get; set; }
public bool? IncludeCategoriesFilterOptions { get; set; }
/// <summary>
/// Gets or sets whether to also include hidden categories.
/// </summary>
public bool? IncludeHiddenCategories { get; set; }
public int? CategoriesFilterOptionsDepth { get; set; }
}
public class AvailableFilters
{
public string? Name { get; set; }
public string[]? Keys { get; set; }
public Sort? Sort { get; set; }
}
public class VariantFilter
{
public required string Name { get; set; }
public required string Key { get; set; }
}
public class Sorting
{
public Sorting(string sortType, Sort? sort)
{
SortType = sortType;
Sort = sort;
}
public string SortType { get; set; }
public Sort? Sort { get; set; }
}
public enum Sort
{
asc,
desc,
popularity
}