2022-10-26 19:55:08 +03:00
|
|
|
const {faker} = require('@faker-js/faker');
|
|
|
|
const TableImporter = require('./base');
|
|
|
|
|
|
|
|
class MembersStripeCustomersImporter extends TableImporter {
|
2023-02-16 15:11:00 +03:00
|
|
|
static table = 'members_stripe_customers';
|
|
|
|
|
2022-10-26 19:55:08 +03:00
|
|
|
constructor(knex) {
|
2023-02-16 15:11:00 +03:00
|
|
|
super(MembersStripeCustomersImporter.table, knex);
|
2022-10-26 19:55:08 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|