Skip to main content
Skip to main content

BaseRepositoryService

admin/discounts.internal.BaseRepositoryService

Data access layer (DAL) interface to implements for any repository service. This layer helps to separate the business logic (service layer) from accessing the ORM directly and allows to switch to another ORM without changing the business logic.

Type parameters

TobjectRequired

Methods

getActiveManager

getActiveManager<TManager>(): TManager

TManagerobjectRequired

Returns

TManager


getFreshManager

getFreshManager<TManager>(): TManager

TManagerobjectRequired

Returns

TManager


serialize

serialize<TOutput>(data, options?): Promise<TOutput>

TOutputobject | object[]Required

Parameters

dataanyRequired
optionsany

Returns

Promise<TOutput>

PromisePromise<TOutput>Required

transaction

transaction<TManager>(task, context?): Promise<any>

TManagerobjectRequired

Parameters

task(transactionManager: TManager) => Promise<any>Required
contextobject
context.enableNestedTransactionsboolean
context.isolationLevelstring
context.transactionTManager

Returns

Promise<any>

PromisePromise<any>Required
Was this section helpful?