Updated offers schema to allow free trials

refs https://github.com/TryGhost/Team/issues/1726

- updates offer type validation to include `trial`
- add offer duration validation which includes `trial` for free trial offers
This commit is contained in:
Rishabh 2022-08-09 13:06:23 +05:30 committed by Rishabh Garg
parent 8a32efac1f
commit 27a89d4b0e

View File

@ -440,9 +440,9 @@ module.exports = {
stripe_coupon_id: {type: 'string', maxlength: 255, nullable: true, unique: true}, stripe_coupon_id: {type: 'string', maxlength: 255, nullable: true, unique: true},
interval: {type: 'string', maxlength: 50, nullable: false, validations: {isIn: [['month', 'year']]}}, interval: {type: 'string', maxlength: 50, nullable: false, validations: {isIn: [['month', 'year']]}},
currency: {type: 'string', maxlength: 50, nullable: true}, currency: {type: 'string', maxlength: 50, nullable: true},
discount_type: {type: 'string', maxlength: 50, nullable: false, validations: {isIn: [['percent', 'amount']]}}, discount_type: {type: 'string', maxlength: 50, nullable: false, validations: {isIn: [['percent', 'amount', 'trial']]}},
discount_amount: {type: 'integer', nullable: false}, discount_amount: {type: 'integer', nullable: false},
duration: {type: 'string', maxlength: 50, nullable: false}, duration: {type: 'string', maxlength: 50, nullable: false, validations: {isIn: [['trial', 'once', 'repeating', 'forever']]}},
duration_in_months: {type: 'integer', nullable: true}, duration_in_months: {type: 'integer', nullable: true},
portal_title: {type: 'string', maxlength: 191, nullable: true}, portal_title: {type: 'string', maxlength: 191, nullable: true},
portal_description: {type: 'string', maxlength: 2000, nullable: true}, portal_description: {type: 'string', maxlength: 2000, nullable: true},