mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
28b11e6fed
refs: https://github.com/TryGhost/Toolbox/issues/440 New command to generate demo data, creates data for over 20 tables in Ghost, suitable for testing most features of the dashboard, as well as making guided product tours using newsletters, tiers, many posts and tags. Usage: `yarn start generate-data` Optionally, keep your existing posts / tags with: `yarn start generate-data --use-existing-tags --use-existing-posts`
29 lines
751 B
JavaScript
29 lines
751 B
JavaScript
const {faker} = require('@faker-js/faker');
|
|
const TableImporter = require('./base');
|
|
|
|
class MembersStripeCustomersImporter extends TableImporter {
|
|
constructor(knex) {
|
|
super('members_stripe_customers', knex);
|
|
}
|
|
|
|
setImportOptions({model}) {
|
|
this.model = model;
|
|
}
|
|
|
|
generate() {
|
|
return {
|
|
id: faker.database.mongodbObjectId(),
|
|
member_id: this.model.id,
|
|
customer_id: `cus_${faker.random.alphaNumeric(14, {
|
|
casing: 'mixed'
|
|
})}`,
|
|
name: this.model.name,
|
|
email: this.model.email,
|
|
created_at: this.model.created_at,
|
|
created_by: 'unused'
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = MembersStripeCustomersImporter;
|