Skip to content

Instantly share code, notes, and snippets.

@craigsdennis
Created March 24, 2023 00:38
Show Gist options
  • Save craigsdennis/5861a9cf932c063d94889d5de31c52fa to your computer and use it in GitHub Desktop.
Save craigsdennis/5861a9cf932c063d94889d5de31c52fa to your computer and use it in GitHub Desktop.
const faker = require('faker');
function generateSocimindProfile() {
const interests = ['Technology', 'Photography', 'Travel', 'Music', 'Fashion', 'Food', 'Fitness', 'Art'];
const follows = ['InfluencerA', 'InfluencerB', 'BrandC', 'BrandD', 'BrandE'];
const profile = {
userId: faker.random.uuid(),
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
email: faker.internet.email(),
phone: faker.phone.phoneNumber(),
gender: faker.random.arrayElement(['male', 'female', 'non-binary']),
birthdate: faker.date.between('1950-01-01', '2003-12-31'),
address: {
street: faker.address.streetAddress(),
city: faker.address.city(),
state: faker.address.stateAbbr(),
zip: faker.address.zipCode(),
},
interests: faker.random.arrayElements(interests),
propensityToBuy: faker.random.number({ min: 0, max: 1, precision: 0.01 }),
lifetimeValue: faker.finance.amount(100, 1000, 2),
customerAcquisitionCost: faker.finance.amount(50, 200, 2),
lastLoginDate: faker.date.recent(),
subscriptionType: faker.random.arrayElement(['Free', 'Premium']),
subscriptionStartDate: faker.date.between('2019-01-01', '2021-12-31'),
subscriptionEndDate: faker.date.between('2022-01-01', '2023-12-31'),
contentViewed: [faker.random.alphaNumeric(8), faker.random.alphaNumeric(8), faker.random.alphaNumeric(8)],
contentEngaged: [faker.random.alphaNumeric(8), faker.random.alphaNumeric(8)],
follows: faker.random.arrayElements(follows),
customerSegment: faker.random.arrayElement(interests),
};
return JSON.stringify(profile);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment