(index: number)
| 99 | } |
| 100 | |
| 101 | function generateUserRow(index: number): UserRow { |
| 102 | const firstName = randomItem(firstNames) |
| 103 | const lastName = randomItem(lastNames) |
| 104 | const domain = randomItem(['gmail.com', 'yahoo.com', 'outlook.com', 'company.com', 'work.org']) |
| 105 | |
| 106 | return { |
| 107 | name: `${firstName} ${lastName}`, |
| 108 | email: `${firstName.toLowerCase()}.${lastName.toLowerCase()}${index}@${domain}`, |
| 109 | age: randomInt(22, 65), |
| 110 | department: randomItem(departments), |
| 111 | salary: randomInt(40000, 200000), |
| 112 | active: randomFloat() > 0.1, // 90% active |
| 113 | hire_date: randomDate(new Date('2015-01-01'), new Date('2024-12-31')), |
| 114 | country: randomItem(countries), |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | async function main() { |
| 119 | console.log(`Seeding ${TABLE_NAME} table for workspace ${WORKSPACE_ID}...`) |
no test coverage detected