feat(pricing,types): price list API + price calculations with price lists (#5498)
**what:** **PriceList Service APIs:** - createPriceList - updatePriceList - addPriceListPrices - removePriceListRules - setPriceListRules - deletePriceList - listPriceLists - listAndCountPriceLists **Price Calculations** - Returns prices with price list prices - Returns a new shape with calculated and original prices Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
This commit is contained in:
15
packages/utils/src/common/array-difference.ts
Normal file
15
packages/utils/src/common/array-difference.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
type ArrayDifferenceElement = string | number
|
||||
|
||||
export function arrayDifference(
|
||||
mainArray: ArrayDifferenceElement[],
|
||||
differingArray: ArrayDifferenceElement[]
|
||||
): ArrayDifferenceElement[] {
|
||||
const mainArraySet = new Set(mainArray)
|
||||
const differingArraySet = new Set(differingArray)
|
||||
|
||||
const difference = [...mainArraySet].filter(
|
||||
(element) => !differingArraySet.has(element)
|
||||
)
|
||||
|
||||
return difference
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
export * from "./array-difference"
|
||||
export * from "./build-query"
|
||||
export * from "./camel-to-snake-case"
|
||||
export * from "./container"
|
||||
export * from "./deduplicate"
|
||||
export * from "./deep-equal-obj"
|
||||
export * from "./errors"
|
||||
export * from "./generate-entity-id"
|
||||
export * from "./get-config-file"
|
||||
@@ -24,11 +27,9 @@ export * from "./set-metadata"
|
||||
export * from "./simple-hash"
|
||||
export * from "./string-to-select-relation-object"
|
||||
export * from "./stringify-circular"
|
||||
export * from "./camel-to-snake-case"
|
||||
export * from "./to-camel-case"
|
||||
export * from "./to-kebab-case"
|
||||
export * from "./to-pascal-case"
|
||||
export * from "./transaction"
|
||||
export * from "./upper-case-first"
|
||||
export * from "./wrap-handler"
|
||||
export * from "./deep-equal-obj"
|
||||
|
||||
Reference in New Issue
Block a user