Skip to main content

Class: PriceListService

Provides layer to manipulate product tags.

Hierarchy

  • Copy to Clipboard

    Copy to Clipboard

Constructors

constructor

new PriceListService(

Copy to Clipboard
)

Parameters

NameType
Copy to Clipboard
Copy to Clipboard

Overrides

TransactionBaseService.constructor

Defined in

packages/medusa/src/services/price-list.ts:57

Properties

__configModule__

Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
__configModule__:
Copy to Clipboard
<
Copy to Clipboard
,
Copy to Clipboard
>

Inherited from

TransactionBaseService.__configModule__

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:10


__container__

Copy to Clipboard
Copy to Clipboard
__container__:
Copy to Clipboard

Inherited from

TransactionBaseService.__container__

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:9


customerGroupService_

Copy to Clipboard
Copy to Clipboard
customerGroupService_:
Copy to Clipboard

Defined in

packages/medusa/src/services/price-list.ts:48


featureFlagRouter_

Copy to Clipboard
Copy to Clipboard
featureFlagRouter_:
Copy to Clipboard

Defined in

packages/medusa/src/services/price-list.ts:55


manager_

Copy to Clipboard
manager_:
Copy to Clipboard

Overrides

TransactionBaseService.manager_

Defined in

packages/medusa/src/services/price-list.ts:45


moneyAmountRepo_

Copy to Clipboard
Copy to Clipboard
moneyAmountRepo_: typeof
Copy to Clipboard

Defined in

packages/medusa/src/services/price-list.ts:53


priceListRepo_

Copy to Clipboard
Copy to Clipboard
priceListRepo_: typeof
Copy to Clipboard

Defined in

packages/medusa/src/services/price-list.ts:52


productService_

Copy to Clipboard
Copy to Clipboard
productService_:
Copy to Clipboard

Defined in

packages/medusa/src/services/price-list.ts:50


productVariantRepo_

Copy to Clipboard
Copy to Clipboard
productVariantRepo_: typeof
Copy to Clipboard

Defined in

packages/medusa/src/services/price-list.ts:54


regionService_

Copy to Clipboard
Copy to Clipboard
regionService_:
Copy to Clipboard

Defined in

packages/medusa/src/services/price-list.ts:49


transactionManager_

Copy to Clipboard
transactionManager_:
Copy to Clipboard
|
Copy to Clipboard

Overrides

TransactionBaseService.transactionManager_

Defined in

packages/medusa/src/services/price-list.ts:46


variantService_

Copy to Clipboard
Copy to Clipboard
variantService_:
Copy to Clipboard

Defined in

packages/medusa/src/services/price-list.ts:51

Methods

addCurrencyFromRegion

Copy to Clipboard
addCurrencyFromRegion<
Copy to Clipboard
>(
Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
[]>

Add

Copy to Clipboard
to an MA record if
Copy to Clipboard
is passed.

Type parameters

NameType
Copy to Clipboard
extends
Copy to Clipboard
|
Copy to Clipboard

Parameters

NameTypeDescription
Copy to Clipboard
Copy to Clipboard
[]
a list of PriceListPrice(Create/Update)Input records

Returns

Copy to Clipboard
<
Copy to Clipboard
[]>

updated

Copy to Clipboard
list

Defined in

packages/medusa/src/services/price-list.ts:512


addPrices

addPrices(

Copy to Clipboard
,
Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
>

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

Parameters

NameTypeDefault valueDescription
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
id of the price list
Copy to Clipboard
Copy to Clipboard
[]
Copy to Clipboard
prices to add
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
whether to replace existing prices

Returns

Copy to Clipboard
<
Copy to Clipboard
>

updated Price List

Defined in

packages/medusa/src/services/price-list.ts:211


atomicPhase_

Copy to Clipboard
atomicPhase_<
Copy to Clipboard
,
Copy to Clipboard
>(
Copy to Clipboard
,
Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
>

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

Name
Copy to Clipboard
Copy to Clipboard

Parameters

NameTypeDescription
Copy to Clipboard
(
Copy to Clipboard
:
Copy to Clipboard
) =>
Copy to Clipboard
<
Copy to Clipboard
>
the transactional work to be done
Copy to Clipboard
Copy to Clipboard
| (
Copy to Clipboard
:
Copy to Clipboard
) =>
Copy to Clipboard
<
Copy to Clipboard
|
Copy to Clipboard
>
the isolation level to be used for the work.
Copy to Clipboard
(
Copy to Clipboard
:
Copy to Clipboard
) =>
Copy to Clipboard
<
Copy to Clipboard
|
Copy to Clipboard
>
Potential error handler

Returns

Copy to Clipboard
<
Copy to Clipboard
>

the result of the transactional work

Inherited from

TransactionBaseService.atomicPhase_

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:50


clearPrices

clearPrices(

Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
>

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

Parameters

NameTypeDescription
Copy to Clipboard
Copy to Clipboard
id of the price list

Returns

Copy to Clipboard
<
Copy to Clipboard
>

updated Price List

Defined in

packages/medusa/src/services/price-list.ts:251


create

create(

Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
>

Creates a Price List

Parameters

NameTypeDescription
Copy to Clipboard
Copy to Clipboard
the Price List to create

Returns

Copy to Clipboard
<
Copy to Clipboard
>

created Price List

Defined in

packages/medusa/src/services/price-list.ts:112


delete

delete(

Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
>

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

Parameters

NameTypeDescription
Copy to Clipboard
Copy to Clipboard
id of the price list

Returns

Copy to Clipboard
<
Copy to Clipboard
>

empty promise

Defined in

packages/medusa/src/services/price-list.ts:265


deletePrices

deletePrices(

Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
>

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

Parameters

NameTypeDescription
Copy to Clipboard
Copy to Clipboard
id of the price list
Copy to Clipboard
Copy to Clipboard
[]
ids of the prices to delete

Returns

Copy to Clipboard
<
Copy to Clipboard
>

updated Price List

Defined in

packages/medusa/src/services/price-list.ts:236


deleteProductPrices

deleteProductPrices(

Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<[
Copy to Clipboard
[],
Copy to Clipboard
]>

Parameters

NameType
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
[]

Returns

Copy to Clipboard
<[
Copy to Clipboard
[],
Copy to Clipboard
]>

Defined in

packages/medusa/src/services/price-list.ts:439


deleteVariantPrices

deleteVariantPrices(

Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<[
Copy to Clipboard
[],
Copy to Clipboard
]>

Parameters

NameType
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
[]

Returns

Copy to Clipboard
<[
Copy to Clipboard
[],
Copy to Clipboard
]>

Defined in

packages/medusa/src/services/price-list.ts:476


list

list(

Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
[]>

Lists Price Lists

Parameters

NameTypeDescription
Copy to Clipboard
Copy to Clipboard
the query object for find
Copy to Clipboard
Copy to Clipboard
<
Copy to Clipboard
>
the config to be used for find

Returns

Copy to Clipboard
<
Copy to Clipboard
[]>

the result of the find operation

Defined in

packages/medusa/src/services/price-list.ts:285


listAndCount

listAndCount(

Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<[
Copy to Clipboard
[],
Copy to Clipboard
]>

Lists Price Lists and adds count

Parameters

NameTypeDescription
Copy to Clipboard
Copy to Clipboard
the query object for find
Copy to Clipboard
Copy to Clipboard
<
Copy to Clipboard
>
the config to be used for find

Returns

Copy to Clipboard
<[
Copy to Clipboard
[],
Copy to Clipboard
]>

the result of the find operation

Defined in

packages/medusa/src/services/price-list.ts:309


listProducts

listProducts(

Copy to Clipboard
,
Copy to Clipboard
,
Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<[
Copy to Clipboard
[],
Copy to Clipboard
]>

Parameters

NameTypeDefault value
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
<
Copy to Clipboard
> |
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
<
Copy to Clipboard
>
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard

Returns

Copy to Clipboard
<[
Copy to Clipboard
[],
Copy to Clipboard
]>

Defined in

packages/medusa/src/services/price-list.ts:357


listVariants

listVariants(

Copy to Clipboard
,
Copy to Clipboard
,
Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<[
Copy to Clipboard
[],
Copy to Clipboard
]>

Parameters

NameTypeDefault value
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
<
Copy to Clipboard
>
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard

Returns

Copy to Clipboard
<[
Copy to Clipboard
[],
Copy to Clipboard
]>

Defined in

packages/medusa/src/services/price-list.ts:405


retrieve

retrieve(

Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
>

Retrieves a product tag by id.

Parameters

NameTypeDescription
Copy to Clipboard
Copy to Clipboard
the id of the product tag to retrieve
Copy to Clipboard
Copy to Clipboard
<
Copy to Clipboard
>
the config to retrieve the tag by

Returns

Copy to Clipboard
<
Copy to Clipboard
>

the collection.

Defined in

packages/medusa/src/services/price-list.ts:88


shouldRetryTransaction_

Copy to Clipboard
shouldRetryTransaction_(
Copy to Clipboard
):
Copy to Clipboard

Parameters

NameType
Copy to Clipboard
Copy to Clipboard
<
Copy to Clipboard
,
Copy to Clipboard
> | {
Copy to Clipboard
:
Copy to Clipboard
}

Returns

Copy to Clipboard

Inherited from

TransactionBaseService.shouldRetryTransaction_

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:31


update

update(

Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
>

Updates a Price List

Parameters

NameTypeDescription
Copy to Clipboard
Copy to Clipboard
the id of the Product List to update
Copy to Clipboard
Copy to Clipboard
the update to apply

Returns

Copy to Clipboard
<
Copy to Clipboard
>

updated Price List

Defined in

packages/medusa/src/services/price-list.ts:160


upsertCustomerGroups_

Copy to Clipboard
upsertCustomerGroups_(
Copy to Clipboard
,
Copy to Clipboard
):
Copy to Clipboard
<
Copy to Clipboard
>

Parameters

NameType
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
{
Copy to Clipboard
:
Copy to Clipboard
}[]

Returns

Copy to Clipboard
<
Copy to Clipboard
>

Defined in

packages/medusa/src/services/price-list.ts:338


withTransaction

withTransaction(

Copy to Clipboard
):
Copy to Clipboard

Parameters

NameType
Copy to Clipboard
Copy to Clipboard

Returns

Inherited from

TransactionBaseService.withTransaction

Defined in

packages/medusa/src/interfaces/transaction-base-service.ts:13