GiftCardService
Provides layer to manipulate gift cards.
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>giftCardRepository_
Repository<GiftCard> & { listGiftCardsAndCount: Method listGiftCardsAndCount }Requiredmanager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredEvents
objectRequiredEvents.CREATED
stringRequiredAccessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
atomicPhase_
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.
Parameters
work
(transactionManager: EntityManager) => Promise<TResult>Requiredthe transactional work to be done
isolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>the isolation level to be used for the work.
maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Potential error handler
Returns
Promise
Promise<TResult>Requiredthe result of the transactional work
create
Creates a gift card with provided data given that the data is validated.
Parameters
the gift card data to create
Returns
the result of the create operation
createTransaction
Parameters
Returns
Promise
Promise<string>Requireddelete
Deletes a gift card idempotently
Parameters
giftCardId
stringRequiredid of gift card to delete
Returns
the result of the delete operation