diff --git a/ghost/data-generator/lib/importers/MembersProductsImporter.js b/ghost/data-generator/lib/importers/MembersProductsImporter.js index ff4a565225..631f563cf1 100644 --- a/ghost/data-generator/lib/importers/MembersProductsImporter.js +++ b/ghost/data-generator/lib/importers/MembersProductsImporter.js @@ -1,6 +1,7 @@ const {faker} = require('@faker-js/faker'); const TableImporter = require('./TableImporter'); const {luck} = require('../utils/random'); +const dateToDatabaseString = require('../utils/database-date'); class MembersProductsImporter extends TableImporter { static table = 'members_products'; @@ -32,7 +33,8 @@ class MembersProductsImporter extends TableImporter { id: faker.database.mongodbObjectId(), member_id: this.model.id, product_id: this.getProduct().id, - sort_order: 0 + sort_order: 0, + expiry_at: this.model.status === 'paid' ? null : (luck(50) ? null : dateToDatabaseString(faker.date.future())) }; } }