PriceListService
Provides layer to manipulate product tags.
constructor
Parameters
__namedParameters
PriceListConstructorPropsRequiredProperties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>featureFlagRouter_
FlagRouterRequiredmanager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
addCurrencyFromRegion
Add currency_code
to an MA record if region_id
is passed.
Type Parameters
Parameters
prices
T[]RequiredReturns
Promise
Promise<T[]>Requiredprices
listaddPrices
Adds prices to a price list in bulk, optionally replacing all existing prices
Parameters
id
stringRequiredreplace
booleanRequiredDefault: false
Returns
atomicPhase_
Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created.
Type Parameters
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
Promise<TResult>RequiredclearPrices
Removes all prices from a price list and deletes the removed prices in bulk
Parameters
id
stringRequiredReturns
Promise
Promise<void>Requiredcreate
Creates a Price List
Parameters
Returns
delete
Deletes a Price List Will never fail due to delete being idempotent.
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequireddeletePrices
Removes prices from a price list and deletes the removed prices in bulk
Parameters
id
stringRequiredpriceIds
string[]RequiredReturns
Promise
Promise<void>RequireddeleteProductPrices
Parameters
priceListId
stringRequiredproductIds
string[]RequiredReturns
Promise
Promise<[string[], number]>RequireddeleteVariantPrices
Parameters
priceListId
stringRequiredvariantIds
string[]RequiredReturns
Promise
Promise<[string[], number]>Requiredlist
Lists Price Lists
Parameters
Default: {}
Returns
listAndCount
Lists Price Lists and adds count
Parameters
Default: {}
Returns
listPriceListsVariantIdsMap
Parameters
priceListIds
string | string[]RequiredReturns
Promise
Promise<object>RequiredlistProducts
Parameters
priceListId
stringRequiredDefault: {}
requiresPriceList
booleanRequiredDefault: false
Returns
listVariants
Parameters
priceListId
stringRequiredDefault: {}
requiresPriceList
booleanRequiredDefault: false
Returns
retrieve
Retrieves a product tag by id.
Parameters
priceListId
stringRequiredDefault: {}
Returns
shouldRetryTransaction_
Parameters
err
Record<string, unknown> | objectRequiredReturns
boolean
booleanupdate
Updates a Price List
Parameters
id
stringRequiredReturns
upsertCustomerGroups_
Parameters
priceListId
stringRequiredcustomerGroups
object[]RequiredReturns
Promise
Promise<void>RequiredwithTransaction
Parameters
transactionManager
EntityManagerReturns
PriceListService
objectRequired