fix(): Pricing preference context loss (#13626)

**What**
The context reference is being mutated by the repository leading to an empty context. Also, the filter is built from the pricing context instead of pricing context -> context leading to always fetch all preferences all the time
This commit is contained in:
Adrien de Peretti authored and GitHub committed 2025-09-30 12:38:04 +00:00
1 parent 087887fefb
commit 9c7c1d48c7
7 files changed
+111 -65

No files matched your search

@@ -1,4 +1,4 @@
import { BaseFilterable } from "../../dal"
import { BaseFilterable, OperatorMap } from "../../dal"
/**
* @interface
@@ -83,13 +83,13 @@ export interface FilterablePricePreferenceProps
/**
* The IDs to filter the price preferences by.
*/
id?: string[]
id?: string | string[] | OperatorMap<string | string[]>
/**
* Attributes to filter price preferences by.
*/
attribute?: string | string[]
attribute?: string | string[] | OperatorMap<string | string[]>
/**
* Values to filter price preferences by.
*/
value?: string | string[]
value?: string | string[] | OperatorMap<string | string[]>
}
@@ -1,4 +1,4 @@
import { BaseFilterable } from "../../dal"
import { BaseFilterable, OperatorMap } from "../../dal"
import { PriceSetDTO } from "./price-set"
/**
@@ -123,15 +123,20 @@ export interface FilterablePriceRuleProps
/**
* The IDs to filter price rules by.
*/
id?: string[]
id?: string | string[] | OperatorMap<string | string[]>
/**
* The names to filter price rules by.
*/
name?: string[]
name?: string | string[] | OperatorMap<string | string[]>
/**
* The IDs to filter the price rule's associated price set.
*/
price_set_id?: string[]
price_set_id?: string | string[] | OperatorMap<string | string[]>
/**
* The IDs to filter the price rule's associated price.
*/
price_id?: string | string[] | OperatorMap<string | string[]>
}
/**
@@ -145,21 +150,21 @@ export type PricingRuleOperatorValues = "gt" | "lt" | "eq" | "lte" | "gte"
export interface PriceRule {
/**
* The attribute to compare.
*
*
* @example
* amount
*/
attribute: string
/**
* The operator to use in the comparison.
*
*
* @example
* gt
*/
operator: PricingRuleOperatorValues
/**
* The value to compare against.
*
*
* @example
* 100
*/