Skip to main content
Skip to main content

PriceListService

Provides layer to manipulate product tags.

constructor

Parameters

__namedParametersPriceListConstructorPropsRequired

Properties

manager_EntityManagerRequired
transactionManager_undefined | EntityManagerRequired
__container__anyRequired
customerGroupService_CustomerGroupServiceRequired
regionService_RegionServiceRequired
productService_ProductServiceRequired
variantService_ProductVariantServiceRequired
priceListRepo_Repository<PriceList> & objectRequired
moneyAmountRepo_Repository<MoneyAmount> & objectRequired
productVariantRepo_Repository<ProductVariant>Required
featureFlagRouter_FlagRouterRequired
__configModule__Record<string, unknown>
__moduleDeclaration__Record<string, unknown>

Accessors

activeManager_

Returns

EntityManagerEntityManagerRequired

Methods

withTransaction

Parameters

transactionManagerEntityManager

Returns

thisthisRequired

shouldRetryTransaction_

Parameters

errRecord<string, unknown> | objectRequired

Returns

booleanbooleanRequired

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

TResultobjectRequired
TErrorobjectRequired

Parameters

work(transactionManager: EntityManager) => Promise<TResult>Required
the transactional work to be done
isolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>
the isolation level to be used for the work.
maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>
Potential error handler

Returns

PromisePromise<TResult>Required
the result of the transactional work

retrieve

Retrieves a product tag by id.

Parameters

priceListIdstringRequired
the id of the product tag to retrieve
configFindConfig<PriceList>Required
the config to retrieve the tag by

Default: {}

Returns

PromisePromise<PriceList>Required
the collection.

listPriceListsVariantIdsMap

Parameters

priceListIdsstring | string[]Required

Returns

PromisePromise<object>Required

create

Creates a Price List

Parameters

priceListObjectCreatePriceListInputRequired
the Price List to create

Returns

PromisePromise<PriceList>Required
created Price List

update

Updates a Price List

Parameters

idstringRequired
the id of the Product List to update
updateUpdatePriceListInputRequired
the update to apply

Returns

PromisePromise<PriceList>Required
updated Price List

addPrices

Adds prices to a price list in bulk, optionally replacing all existing prices

Parameters

idstringRequired
id of the price list
prices to add
replacebooleanRequired
whether to replace existing prices

Default: false

Returns

PromisePromise<PriceList>Required
updated Price List

deletePrices

Removes prices from a price list and deletes the removed prices in bulk

Parameters

idstringRequired
id of the price list
priceIdsstring[]Required
ids of the prices to delete

Returns

PromisePromise<void>Required
updated Price List

clearPrices

Removes all prices from a price list and deletes the removed prices in bulk

Parameters

idstringRequired
id of the price list

Returns

PromisePromise<void>Required
updated Price List

delete

Deletes a Price List Will never fail due to delete being idempotent.

Parameters

idstringRequired
id of the price list

Returns

PromisePromise<void>Required
empty promise

list

Lists Price Lists

Parameters

selectorFilterablePriceListPropsRequired
the query object for find

Default: {}

configFindConfig<PriceList>Required
the config to be used for find

Returns

PromisePromise<PriceList[]>Required
the result of the find operation

listAndCount

Lists Price Lists and adds count

Parameters

selectorFilterablePriceListPropsRequired
the query object for find

Default: {}

configFindConfig<PriceList>Required
the config to be used for find

Returns

PromisePromise<[PriceList[], number]>Required
the result of the find operation

upsertCustomerGroups_

Parameters

priceListIdstringRequired
customerGroupsobject[]Required

Returns

PromisePromise<void>Required

listProducts

Parameters

priceListIdstringRequired

Default: {}

configFindConfig<Product>Required
requiresPriceListbooleanRequired

Default: false

Returns

PromisePromise<[Product[], number]>Required

listVariants

Parameters

priceListIdstringRequired

Default: {}

configFindConfig<ProductVariant>Required
requiresPriceListbooleanRequired

Default: false

Returns

PromisePromise<[ProductVariant[], number]>Required

deleteProductPrices

Parameters

priceListIdstringRequired
productIdsstring[]Required

Returns

PromisePromise<[string[], number]>Required

deleteVariantPrices

Parameters

priceListIdstringRequired
variantIdsstring[]Required

Returns

PromisePromise<[string[], number]>Required

addCurrencyFromRegion

Add currency_code to an MA record if region_idis passed.

Type Parameters

Parameters

pricesT[]Required
a list of PriceListPrice(Create/Update)Input records

Returns

PromisePromise<T[]>Required
updated prices list
Was this section helpful?