mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-26 13:35:16 +03:00
5674036902
refs https://github.com/TryGhost/Team/issues/1083 This is the initial scaffolding for setting up Offers in Ghost
28 lines
799 B
JavaScript
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;
|