mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-10 11:24:39 +03:00
Improved types for Offer
no-issue This splits out the types of the Offers properties from the types of the expected values to be passed to create.
This commit is contained in:
parent
2b58ecd82e
commit
170591a113
@ -9,7 +9,7 @@ const Offer = require('./domain/models/Offer');
|
||||
|
||||
/**
|
||||
* @param {any} json
|
||||
* @returns {Offer.OfferProps}
|
||||
* @returns {Offer.OfferCreateProps}
|
||||
*/
|
||||
function toDomain(json) {
|
||||
return {
|
||||
|
@ -27,6 +27,22 @@ const OfferCurrency = require('./OfferCurrency');
|
||||
* @prop {OfferTier} tier
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} OfferCreateProps
|
||||
* @prop {string} id
|
||||
* @prop {string} name
|
||||
* @prop {string} code
|
||||
* @prop {string} display_title
|
||||
* @prop {string} display_description
|
||||
* @prop {string} cadence
|
||||
* @prop {string} type
|
||||
* @prop {number} amount
|
||||
* @prop {string} duration
|
||||
* @prop {string} currency
|
||||
* @prop {string} [stripe_coupon_id]
|
||||
* @prop {TierProps|OfferTier} tier
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} UniqueChecker
|
||||
* @prop {(code: OfferCode) => Promise<boolean>} isUniqueCode
|
||||
|
Loading…
Reference in New Issue
Block a user