Skip to main content

Class: CurrencyService

Hierarchy

  • TransactionBaseServiceCopy to Clipboard

    CurrencyServiceCopy to Clipboard

Constructors

constructor

new CurrencyService(__namedParametersCopy to Clipboard)

Parameters

NameType
__namedParametersCopy to ClipboardInjectedDependenciesCopy to Clipboard

Overrides

TransactionBaseService.constructor

Defined in

medusa/src/services/currency.ts:29

Properties

__configModule__

ProtectedCopy to Clipboard OptionalCopy to Clipboard ReadonlyCopy to Clipboard __configModule__: RecordCopy to Clipboard<stringCopy to Clipboard, unknownCopy to Clipboard>

Inherited from

TransactionBaseService.__configModule__

Defined in

medusa/src/interfaces/transaction-base-service.ts:14


__container__

ProtectedCopy to Clipboard ReadonlyCopy to Clipboard __container__: anyCopy to Clipboard

Inherited from

TransactionBaseService.__container__

Defined in

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


__moduleDeclaration__

ProtectedCopy to Clipboard OptionalCopy to Clipboard ReadonlyCopy to Clipboard __moduleDeclaration__: RecordCopy to Clipboard<stringCopy to Clipboard, unknownCopy to Clipboard>

Inherited from

TransactionBaseService.__moduleDeclaration__

Defined in

medusa/src/interfaces/transaction-base-service.ts:15


currencyRepository_

ProtectedCopy to Clipboard ReadonlyCopy to Clipboard currencyRepository_: RepositoryCopy to Clipboard<CurrencyCopy to Clipboard>

Defined in

medusa/src/services/currency.ts:25


eventBusService_

ProtectedCopy to Clipboard ReadonlyCopy to Clipboard eventBusService_: EventBusServiceCopy to Clipboard

Defined in

medusa/src/services/currency.ts:26


featureFlagRouter_

ProtectedCopy to Clipboard ReadonlyCopy to Clipboard featureFlagRouter_: FlagRouterCopy to Clipboard

Defined in

medusa/src/services/currency.ts:27


manager_

ProtectedCopy to Clipboard manager_: EntityManagerCopy to Clipboard

Inherited from

TransactionBaseService.manager_

Defined in

medusa/src/interfaces/transaction-base-service.ts:5


transactionManager_

ProtectedCopy to Clipboard transactionManager_: undefinedCopy to Clipboard | EntityManagerCopy to Clipboard

Inherited from

TransactionBaseService.transactionManager_

Defined in

medusa/src/interfaces/transaction-base-service.ts:6


Events

StaticCopy to Clipboard ReadonlyCopy to Clipboard Events: ObjectCopy to Clipboard

Type declaration

NameType
UPDATEDCopy to ClipboardstringCopy to Clipboard

Defined in

medusa/src/services/currency.ts:21

Accessors

activeManager_

ProtectedCopy to Clipboard getCopy to Clipboard activeManager_(): EntityManagerCopy to Clipboard

Returns

EntityManagerCopy to Clipboard

Inherited from

TransactionBaseService.activeManager_

Defined in

medusa/src/interfaces/transaction-base-service.ts:8

Methods

atomicPhase_

ProtectedCopy to Clipboard atomicPhase_<TResultCopy to Clipboard, TErrorCopy to Clipboard>(workCopy to Clipboard, isolationOrErrorHandler?Copy to Clipboard, maybeErrorHandlerOrDontFail?Copy to Clipboard): PromiseCopy to Clipboard<TResultCopy 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
TResultCopy to Clipboard
TErrorCopy to Clipboard

Parameters

NameTypeDescription
workCopy to Clipboard(transactionManagerCopy to Clipboard: EntityManagerCopy to Clipboard) => PromiseCopy to Clipboard<TResultCopy to Clipboard>the transactional work to be done
isolationOrErrorHandler?Copy to ClipboardIsolationLevelCopy to Clipboard | (errorCopy to Clipboard: TErrorCopy to Clipboard) => PromiseCopy to Clipboard<voidCopy to Clipboard | TResultCopy to Clipboard>the isolation level to be used for the work.
maybeErrorHandlerOrDontFail?Copy to Clipboard(errorCopy to Clipboard: TErrorCopy to Clipboard) => PromiseCopy to Clipboard<voidCopy to Clipboard | TResultCopy to Clipboard>Potential error handler

Returns

PromiseCopy to Clipboard<TResultCopy to Clipboard>

the result of the transactional work

Inherited from

TransactionBaseService.atomicPhase_

Defined in

medusa/src/interfaces/transaction-base-service.ts:56


listAndCount

listAndCount(selectorCopy to Clipboard, config?Copy to Clipboard): PromiseCopy to Clipboard<[CurrencyCopy to Clipboard[], numberCopy to Clipboard]>

Lists currencies based on the provided parameters and includes the count of currencies that match the query.

Parameters

NameTypeDescription
selectorCopy to ClipboardSelectorCopy to Clipboard<CurrencyCopy to Clipboard>an object that defines rules to filter currencies by
configCopy to ClipboardFindConfigCopy to Clipboard<CurrencyCopy to Clipboard>object that defines the scope for what should be returned

Returns

PromiseCopy to Clipboard<[CurrencyCopy to Clipboard[], numberCopy to Clipboard]>

an array containing the currencies as the first element and the total count of products that matches the query as the second element.

Defined in

medusa/src/services/currency.ts:78


retrieveByCode

retrieveByCode(codeCopy to Clipboard): PromiseCopy to Clipboard<CurrencyCopy to Clipboard>

Return the currency

Parameters

NameTypeDescription
codeCopy to ClipboardstringCopy to ClipboardThe code of the currency that must be retrieve

Returns

PromiseCopy to Clipboard<CurrencyCopy to Clipboard>

The currency

Defined in

medusa/src/services/currency.ts:47


shouldRetryTransaction_

ProtectedCopy to Clipboard shouldRetryTransaction_(errCopy to Clipboard): booleanCopy to Clipboard

Parameters

NameType
errCopy to ClipboardRecordCopy to Clipboard<stringCopy to Clipboard, unknownCopy to Clipboard> | { codeCopy to Clipboard: stringCopy to Clipboard }

Returns

booleanCopy to Clipboard

Inherited from

TransactionBaseService.shouldRetryTransaction_

Defined in

medusa/src/interfaces/transaction-base-service.ts:37


update

update(codeCopy to Clipboard, dataCopy to Clipboard): PromiseCopy to Clipboard<undefinedCopy to Clipboard | CurrencyCopy to Clipboard>

Update a currency

Parameters

NameTypeDescription
codeCopy to ClipboardstringCopy to ClipboardThe code of the currency to update
dataCopy to ClipboardUpdateCurrencyInputCopy to ClipboardThe data that must be updated on the currency

Returns

PromiseCopy to Clipboard<undefinedCopy to Clipboard | CurrencyCopy to Clipboard>

The updated currency

Defined in

medusa/src/services/currency.ts:100


withTransaction

withTransaction(transactionManager?Copy to Clipboard): CurrencyServiceCopy to Clipboard

Parameters

NameType
transactionManager?Copy to ClipboardEntityManagerCopy to Clipboard

Returns

CurrencyServiceCopy to Clipboard

Inherited from

TransactionBaseService.withTransaction

Defined in

medusa/src/interfaces/transaction-base-service.ts:20

Was this page helpful?