UNPKG

@wepublish/api

Version:
38 lines 1.61 kB
"use strict"; var PaymentsModule_1; Object.defineProperty(exports, "__esModule", { value: true }); exports.PaymentsModule = void 0; const tslib_1 = require("tslib"); const common_1 = require("@nestjs/common"); const nest_modules_1 = require("@wepublish/nest-modules"); const payments_service_1 = require("./payments.service"); const api_1 = require("../../../utils-api/src"); const payments_module_options_1 = require("./payments-module-options"); const client_1 = require("@prisma/client"); let PaymentsModule = exports.PaymentsModule = PaymentsModule_1 = class PaymentsModule { static registerAsync(options) { return { module: PaymentsModule_1, global: options.global, imports: options.imports || [], providers: this.createAsyncProviders(options) }; } static createAsyncProviders(options) { return [ (0, api_1.createAsyncOptionsProvider)(payments_module_options_1.PAYMENTS_MODULE_OPTIONS, options), { provide: payments_service_1.PaymentsService, useFactory: (prisma, { paymentProviders }) => new payments_service_1.PaymentsService(prisma, paymentProviders), inject: [client_1.PrismaClient, payments_module_options_1.PAYMENTS_MODULE_OPTIONS] } ]; } }; exports.PaymentsModule = PaymentsModule = PaymentsModule_1 = tslib_1.__decorate([ (0, common_1.Module)({ imports: [nest_modules_1.PrismaModule], exports: [payments_service_1.PaymentsService] }) ], PaymentsModule); //# sourceMappingURL=payments.module.js.map