Skip to main content

Class: ProductTypeService

Hierarchy

  • TransactionBaseServiceCopy to Clipboard

    ProductTypeServiceCopy to Clipboard

Constructors

constructor

new ProductTypeService(__namedParametersCopy to Clipboard)

Parameters

NameType
__namedParametersCopy to ClipboardObjectCopy to Clipboard

Overrides

TransactionBaseService.constructor

Defined in

packages/medusa/src/services/product-type.ts:15

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

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


__container__

ProtectedCopy to Clipboard ReadonlyCopy to Clipboard __container__: anyCopy to Clipboard

Inherited from

TransactionBaseService.__container__

Defined in

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


__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

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


manager_

ProtectedCopy to Clipboard manager_: EntityManagerCopy to Clipboard

Overrides

TransactionBaseService.manager_

Defined in

packages/medusa/src/services/product-type.ts:10


transactionManager_

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

Overrides

TransactionBaseService.transactionManager_

Defined in

packages/medusa/src/services/product-type.ts:11


typeRepository_

ProtectedCopy to Clipboard ReadonlyCopy to Clipboard typeRepository_: typeof ProductTypeRepositoryCopy to Clipboard

Defined in

packages/medusa/src/services/product-type.ts:13

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

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


list

list(selector?Copy to Clipboard, config?Copy to Clipboard): PromiseCopy to Clipboard<ProductTypeCopy to Clipboard[]>

Lists product types

Parameters

NameTypeDescription
selectorCopy to ClipboardSelectorCopy to Clipboard<ProductTypeCopy to Clipboard> & { discount_condition_id?Copy to Clipboard: stringCopy to Clipboard ; q?Copy to Clipboard: stringCopy to Clipboard }the query object for find
configCopy to ClipboardFindConfigCopy to Clipboard<ProductTypeCopy to Clipboard>the config to be used for find

Returns

PromiseCopy to Clipboard<ProductTypeCopy to Clipboard[]>

the result of the find operation

Defined in

packages/medusa/src/services/product-type.ts:55


listAndCount

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

Lists product types and adds count.

Parameters

NameTypeDescription
selectorCopy to ClipboardSelectorCopy to Clipboard<ProductTypeCopy to Clipboard> & { discount_condition_id?Copy to Clipboard: stringCopy to Clipboard ; q?Copy to Clipboard: stringCopy to Clipboard }the query object for find
configCopy to ClipboardFindConfigCopy to Clipboard<ProductTypeCopy to Clipboard>the config to be used for find

Returns

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

the result of the find operation

Defined in

packages/medusa/src/services/product-type.ts:72


retrieve

retrieve(idCopy to Clipboard, config?Copy to Clipboard): PromiseCopy to Clipboard<ProductTypeCopy to Clipboard>

Gets a product type by id. Throws in case of DB Error and if product was not found.

Parameters

NameTypeDescription
idCopy to ClipboardstringCopy to Clipboardid of the product to get.
configCopy to ClipboardFindConfigCopy to Clipboard<ProductTypeCopy to Clipboard>object that defines what should be included in the query response

Returns

PromiseCopy to Clipboard<ProductTypeCopy to Clipboard>

the result of the find one operation.

Defined in

packages/medusa/src/services/product-type.ts:30


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

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


withTransaction

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

Parameters

NameType
transactionManager?Copy to ClipboardEntityManagerCopy to Clipboard

Returns

ProductTypeServiceCopy to Clipboard

Inherited from

TransactionBaseService.withTransaction

Defined in

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