29 lines
698 B
JavaScript
29 lines
698 B
JavaScript
import faker from 'faker';
|
|
|
|
faker.locale = 'sv';
|
|
|
|
const AVAILABLE_SERVICES = ['KROM', 'STOM', 'KVL'];
|
|
|
|
function generateParticipants(amount = 10) {
|
|
const participants = [];
|
|
|
|
for (let id = 0; id <= amount; ++id) {
|
|
participants.push({
|
|
id,
|
|
firstName: faker.name.firstName(),
|
|
lastName: faker.name.lastName(),
|
|
service: AVAILABLE_SERVICES[Math.floor(Math.random() * AVAILABLE_SERVICES.length)],
|
|
errandNumber: faker.random.number({ min: 100000, max: 999999 }),
|
|
startDate: faker.date.recent(),
|
|
endDate: faker.date.future(),
|
|
handleBefore: faker.date.soon(),
|
|
});
|
|
}
|
|
|
|
return participants;
|
|
}
|
|
|
|
export default {
|
|
generate: generateParticipants,
|
|
};
|