Adde some options inside the mock-api

This commit is contained in:
Erik Tiekstra
2021-03-29 12:13:06 +02:00
committed by Erik Tiekstra
parent 4f6038b2a6
commit 99db911f39
5 changed files with 443 additions and 334 deletions

View File

@@ -3,6 +3,8 @@ import faker from 'faker';
faker.locale = 'sv';
const AVAILABLE_SERVICES = ['KROM', 'STOM', 'KVL'];
const STATUSES = ['active', 'follow-up'];
const STEPS = ['Gemensam planering', 'Periodisk rapport', 'Resultatrapport', 'Slutrapport'];
function generateParticipants(amount = 10) {
const participants = [];
@@ -12,7 +14,9 @@ function generateParticipants(amount = 10) {
id,
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
status: STATUSES[Math.floor(Math.random() * STATUSES.length)],
service: AVAILABLE_SERVICES[Math.floor(Math.random() * AVAILABLE_SERVICES.length)],
nextStep: STEPS[Math.floor(Math.random() * STEPS.length)],
errandNumber: faker.random.number({ min: 100000, max: 999999 }),
startDate: faker.date.recent(),
endDate: faker.date.future(),