feat: Add support for search to all endpoints (#7149)

* feat: Add search capability to api keys

* feat: Add support for searching to currency and customer endpoints

* fix: Clean up product search filters

* feat: Add search support to regions

* feat: Add search support to sales channels

* feat: Add search support to store module

* feat: Add search support to user module

* fix: Clean up inventory search

* feat: Add search support for payments

* fix: Add searchable attributes to stock location models

* feat: Add search support to tax

* feat: Add search support to promotions

* feat: Add search support for pricing, filtering cleanup

* fix: Further cleanups around search
This commit is contained in:
Stevche Radevski authored and GitHub committed 2024-04-25 17:36:59 +02:00
1 parent d02905cefa
commit f03a822253
52 files changed
+640 -64

No files matched your search

@@ -67,6 +67,10 @@ export interface ApiKeyDTO {
*/
export interface FilterableApiKeyProps
extends BaseFilterable<FilterableApiKeyProps> {
/**
* Search through the api key names and redacted keys using this search term.
*/
q?: string
/**
* The IDs to filter the API keys by.
*/
@@ -43,6 +43,10 @@ export interface CurrencyDTO {
*/
export interface FilterableCurrencyProps
extends BaseFilterable<FilterableCurrencyProps> {
/**
* Search through currencies using this search term.
*/
q?: string
/**
* The codes to filter the currencies by.
*/
+15
View File
@@ -102,6 +102,11 @@ export interface CustomerAddressDTO {
*/
export interface FilterableCustomerAddressProps
extends BaseFilterable<FilterableCustomerAddressProps> {
/**
* Searches for addreses by properties such as name and street using this search term.
*/
q?: string
/**
* The IDs to filter the customer address by.
*/
@@ -203,6 +208,11 @@ export interface FilterableCustomerAddressProps
*/
export interface FilterableCustomerGroupProps
extends BaseFilterable<FilterableCustomerGroupProps> {
/**
* Searches for customer groups by name using this search term.
*/
q?: string
/**
* The IDs to filter the customer group by.
*/
@@ -285,6 +295,11 @@ export interface FilterableCustomerGroupCustomerProps
*/
export interface FilterableCustomerProps
extends BaseFilterable<FilterableCustomerProps> {
/**
* Searches for customers by properties such as name and email using this search term.
*/
q?: string
/**
* The IDs to filter the customer by.
*/
@@ -101,6 +101,11 @@ export interface InventoryItemDTO {
* The filters to apply on retrieved inventory items.
*/
export interface FilterableInventoryItemProps {
/**
* Search term to search inventory items' attributes.
*/
q?: string
/**
* The IDs to filter inventory items by.
*/
@@ -111,11 +116,6 @@ export interface FilterableInventoryItemProps {
*/
location_id?: string | string[]
/**
* Search term to search inventory items' attributes.
*/
q?: string
/**
* The SKUs to filter inventory items by.
*/
+5
View File
@@ -419,6 +419,11 @@ export interface PaymentDTO {
*/
export interface FilterablePaymentProps
extends BaseFilterable<FilterablePaymentProps> {
/**
* Find payments based on cart, order, or customer IDs through this search term.
*/
q?: string
/**
* The IDs to filter the payments by.
*/
@@ -1,4 +1,4 @@
import { BaseFilterable } from "../../dal"
import { BaseFilterable, OperatorMap } from "../../dal"
import {
CreateMoneyAmountDTO,
MoneyAmountDTO,
@@ -240,18 +240,22 @@ export interface UpdatePriceListDTO {
*/
export interface FilterablePriceListProps
extends BaseFilterable<FilterablePriceListProps> {
/**
* Find price lists by title or description through this search term.
*/
q?: string
/**
* The IDs to filter price lists by
*/
id?: string[]
id?: string | string[]
/**
* The start dates to filter price lists by.
*/
starts_at?: string[]
starts_at?: OperatorMap<string>
/**
* The end dates to filter price lists by.
*/
ends_at?: string[]
ends_at?: OperatorMap<string>
/**
* The statuses to filter price lists by.
*/
+4 -4
View File
@@ -888,6 +888,10 @@ export interface FilterableProductVariantProps
*/
export interface FilterableProductCategoryProps
extends BaseFilterable<FilterableProductCategoryProps> {
/**
* Filter product categories based on searchable fields
*/
q?: string
/**
* The IDs to filter product categories by.
*/
@@ -920,10 +924,6 @@ export interface FilterableProductCategoryProps
* Whether to include parents of retrieved product categories.
*/
include_ancestors_tree?: boolean
/**
* Filter product categories based on searchable fields
*/
q?: string
}
/**
@@ -51,6 +51,10 @@ export interface CampaignDTO {
*/
export interface FilterableCampaignProps
extends BaseFilterable<FilterableCampaignProps> {
/**
* Find campaigns by their name or description through this search term.
*/
q?: string
/**
* The IDs to filter the campaigns by.
*/
@@ -141,6 +141,11 @@ export interface UpdatePromotionDTO {
*/
export interface FilterablePromotionProps
extends BaseFilterable<FilterablePromotionProps> {
/**
* The IDs to filter the promotions by.
*/
q?: string
/**
* The IDs to filter the promotions by.
*/
+4
View File
@@ -90,6 +90,10 @@ export interface RegionCountryDTO {
*/
export interface FilterableRegionProps
extends BaseFilterable<FilterableRegionProps> {
/**
* Find regions by name through this search term
*/
q?: string
/**
* The IDs to filter the regions by.
*/
@@ -60,6 +60,11 @@ export interface SalesChannelDTO {
*/
export interface FilterableSalesChannelProps
extends BaseFilterable<FilterableSalesChannelProps> {
/**
* Find sales channels by their name or description through this search term.
*/
q?: string
/**
* The IDs to filter the sales channel by.
*/
+4
View File
@@ -60,6 +60,10 @@ export interface StoreDTO {
*/
export interface FilterableStoreProps
extends BaseFilterable<FilterableStoreProps> {
/**
* Find stores by name through this search term.
*/
q?: string
/**
* The IDs to filter the stores by.
*/
+10
View File
@@ -93,6 +93,11 @@ export interface TaxProviderDTO {
*/
export interface FilterableTaxRateProps
extends BaseFilterable<FilterableTaxRateProps> {
/**
* Find tax rates based on name and code properties through this search term.
*/
q?: string
/**
* The IDs to filter the tax rates by.
*/
@@ -190,6 +195,11 @@ export interface TaxRegionDTO {
*/
export interface FilterableTaxRegionProps
extends BaseFilterable<FilterableTaxRegionProps> {
/**
* Find tax regions based on currency and province codes through this search term.
*/
q?: string
/**
* The IDs to filter the tax regions by.
*/
+4
View File
@@ -52,6 +52,10 @@ export interface UserDTO {
*/
export interface FilterableUserProps
extends BaseFilterable<FilterableUserProps> {
/**
* Find users by name or email through this search term
*/
q?: string
/**
* The IDs to filter users by.
*/