35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import faker from 'faker';
|
|
import services from './services.js';
|
|
|
|
faker.locale = 'sv';
|
|
|
|
const SERVICES = services.generate();
|
|
const STATUSES = ['active', 'follow-up'];
|
|
const STEPS = ['Gemensam planering', 'Periodisk rapport', 'Resultatrapport', 'Slutrapport'];
|
|
|
|
function generateParticipants(amount = 10) {
|
|
const participants = [];
|
|
|
|
for (let i = 1; i <= amount; ++i) {
|
|
const participant = {
|
|
id: faker.random.uuid(),
|
|
firstName: faker.name.firstName(),
|
|
lastName: faker.name.lastName(),
|
|
status: STATUSES[Math.floor(Math.random() * STATUSES.length)],
|
|
service: SERVICES[Math.floor(Math.random() * SERVICES.length)].name,
|
|
nextStep: STEPS[Math.floor(Math.random() * STEPS.length)],
|
|
errandNumber: faker.random.number({ min: 100000, max: 999999 }),
|
|
startDate: faker.date.recent(),
|
|
endDate: faker.date.future(),
|
|
handleBefore: faker.date.soon(),
|
|
};
|
|
participants.push({ ...participant, fullName: `${participant.firstName} ${participant.lastName}` });
|
|
}
|
|
|
|
return participants;
|
|
}
|
|
|
|
export default {
|
|
generate: generateParticipants,
|
|
};
|