Ghost/ghost/offers/index.js
Fabien O'Carroll 5674036902 Added initial Offers module
refs https://github.com/TryGhost/Team/issues/1083

This is the initial scaffolding for setting up Offers in Ghost
2021-10-05 11:19:15 +02:00

28 lines
799 B
JavaScript

const OfferRepository = require('./lib/OfferRepository');
const OffersAPI = require('./lib/OffersAPI');
class OffersModule {
/**
* @param {OffersAPI} offersAPI
*/
constructor(offersAPI) {
this.api = offersAPI;
}
/**
* @param {object} deps
* @param {import('@tryghost/express-dynamic-redirects')} deps.redirectManager
* @param {import('@tryghost/members-stripe-service')} deps.stripeAPIService
* @param {any} deps.OfferModel
*
* @returns {OffersModule}
*/
static create(deps) {
const repository = new OfferRepository(deps.OfferModel, deps.stripeAPIService, deps.redirectManager);
const offersAPI = new OffersAPI(repository);
return new OffersModule(offersAPI);
}
}
module.exports = OffersModule;