mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05: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
2 changed files with 17 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue