Skip to content

Commit

Permalink
Merge pull request #61 from Relewise/feat/retailmedia
Browse files Browse the repository at this point in the history
Feat: Retail Media
  • Loading branch information
mzanoni authored Jun 24, 2024
2 parents 34aa5b1 + 5aa74a3 commit febbedb
Show file tree
Hide file tree
Showing 3 changed files with 1,071 additions and 308 deletions.
10 changes: 9 additions & 1 deletion packages/client/src/builders/search/productSearchBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProductSearchRequest, ProductSearchSettings, RecommendationSettings, SelectedBrandPropertiesSettings, SelectedProductPropertiesSettings, SelectedVariantPropertiesSettings, VariantSearchSettings } from '../../models/data-contracts';
import { ProductSearchRequest, ProductSearchSettings, RecommendationSettings, RetailMediaQuery, SelectedBrandPropertiesSettings, SelectedProductPropertiesSettings, SelectedVariantPropertiesSettings, VariantSearchSettings } from '../../models/data-contracts';
import { PaginationBuilder } from '../paginationBuilder';
import { Settings } from '../settings';
import { FacetBuilder } from './facetBuilder';
Expand All @@ -8,6 +8,7 @@ import { SearchRequestBuilder } from './searchRequestBuilder';

export class ProductSearchBuilder extends SearchRequestBuilder implements SearchBuilder {
private facetBuilder: FacetBuilder = new FacetBuilder();
private retailMediaQuery: RetailMediaQuery | null = null;
private paginationBuilder: PaginationBuilder = new PaginationBuilder();
private sortingBuilder: ProductSortingBuilder = new ProductSortingBuilder();
private term: string | null | undefined;
Expand Down Expand Up @@ -69,6 +70,12 @@ export class ProductSearchBuilder extends SearchRequestBuilder implements Search
return this;
}

public setRetailMedia(query: RetailMediaQuery | null): this {
this.retailMediaQuery = query;

return this;
}

/**
* Set the term used to filter products by
*/
Expand Down Expand Up @@ -110,6 +117,7 @@ export class ProductSearchBuilder extends SearchRequestBuilder implements Search
facets: this.facetBuilder.build(),
settings: this.searchSettings,
sorting: this.sortingBuilder.build(),
retailMedia: this.retailMediaQuery,
} as ProductSearchRequest;
}
}
Loading

0 comments on commit febbedb

Please sign in to comment.