Skip to main content

Class: StoreService

Provides layer to manipulate store settings.

Hierarchy

  • "medusa-interfaces"

    StoreService

Constructors

constructor

new StoreService(__namedParameters)

Parameters

NameType
__namedParametersObject

Overrides

BaseService.constructor

Defined in

services/store.js:10

Methods

addCurrency

addCurrency(code): Promise<any>

Add a currency to the store

Parameters

NameTypeDescription
codestring3 character ISO currency code

Returns

Promise<any>

result after update

Defined in

services/store.js:203


create

create(): Promise<Store>

Creates a store if it doesn't already exist.

Returns

Promise<Store>

the store.

Defined in

services/store.js:52


decorate

decorate(store, fields, expandFields?): Store

Decorates a store object.

Parameters

NameTypeDefault valueDescription
storeStoreundefinedthe store to decorate.
fieldsstring[]undefinedthe fields to include.
expandFieldsstring[][]fields to expand.

Returns

Store

return the decorated Store.

Defined in

services/store.js:266


getDefaultCurrency_

getDefaultCurrency_(code): Object

Parameters

NameType
codeany

Returns

Object

NameType
codeany
nameany
symbolany
symbol_nativeany

Defined in

services/store.js:92


removeCurrency

removeCurrency(code): Promise<any>

Removes a currency from the store

Parameters

NameTypeDescription
codestring3 character ISO currency code

Returns

Promise<any>

result after update

Defined in

services/store.js:242


retrieve

retrieve(relations?): Promise<Store>

Retrieve the store settings. There is always a maximum of one store.

Parameters

NameTypeDefault valueDescription
relationsstring[][]relations to fetch with store

Returns

Promise<Store>

the store

Defined in

services/store.js:84


update

update(update): Promise<any>

Updates a store

Parameters

NameTypeDescription
updateanyan object with the update values.

Returns

Promise<any>

resolves to the update result.

Defined in

services/store.js:108


withTransaction

withTransaction(transactionManager): StoreService

Parameters

NameType
transactionManagerany

Returns

StoreService

Defined in

services/store.js:31