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:
Riqwan Thamir
2023-11-15 21:24:29 +01:00
committed by GitHub
parent 2947f57db1
commit 1772e80ed1
58 changed files with 5745 additions and 1112 deletions

View 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
}

View File

@@ -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"