Added some functionality and some new data to mock-api

This commit is contained in:
Erik Tiekstra
2021-03-29 10:17:00 +02:00
committed by Erik Tiekstra
parent cfe1907842
commit c03b66c6bc
11 changed files with 490 additions and 308 deletions

View File

@@ -5,7 +5,7 @@
</a> </a>
</div> </div>
<ul class="navigation__list dafa__hide-on-print"> <ul class="navigation__list dafa__hide-on-print">
<li class="navigation__item"> <!-- <li class="navigation__item">
<a <a
class="navigation__link" class="navigation__link"
[routerLink]="['/']" [routerLink]="['/']"
@@ -15,7 +15,7 @@
<dafa-icon [icon]="iconType.HOME" size="l"></dafa-icon> <dafa-icon [icon]="iconType.HOME" size="l"></dafa-icon>
<span class="navigation__text">Startsida</span> <span class="navigation__text">Startsida</span>
</a> </a>
</li> </li> -->
<li class="navigation__item" *ngIf="user"> <li class="navigation__item" *ngIf="user">
<div class="navigation__no-link"> <div class="navigation__no-link">
<dafa-icon [icon]="iconType.USER" size="l"></dafa-icon> <dafa-icon [icon]="iconType.USER" size="l"></dafa-icon>

View File

@@ -6,4 +6,8 @@ export interface Participant {
lastName: string; lastName: string;
service: Service; service: Service;
errandNumber: number; errandNumber: number;
startDate: Date;
endDate: Date;
handleBefore: Date;
fullName?: string;
} }

View File

@@ -2,11 +2,60 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<th scope="col">Namn</th> <th scope="col" class="participants-list__column-head">
<th scope="col">Ärendenummer</th> <button class="participants-list__sort-button" (click)="handleSort('fullName')">
<th scope="col">Tjänst</th> Namn
<th scope="col">Startdatum</th> <ng-container *ngIf="sortBy?.key === 'fullName'">
<th scope="col">Slutdatum</th> <digi-icon-caret-up class="participants-list__sort-icon" *ngIf="!sortBy.reverse"></digi-icon-caret-up>
<digi-icon-caret-down class="participants-list__sort-icon" *ngIf="sortBy.reverse"></digi-icon-caret-down>
</ng-container>
</button>
</th>
<th scope="col" class="participants-list__column-head">
<button class="participants-list__sort-button" (click)="handleSort('errandNumber')">
Ärendenummer
<ng-container *ngIf="sortBy?.key === 'errandNumber'">
<digi-icon-caret-up class="participants-list__sort-icon" *ngIf="!sortBy.reverse"></digi-icon-caret-up>
<digi-icon-caret-down class="participants-list__sort-icon" *ngIf="sortBy.reverse"></digi-icon-caret-down>
</ng-container>
</button>
</th>
<th scope="col" class="participants-list__column-head">
<button class="participants-list__sort-button" (click)="handleSort('service')">
Tjänst
<ng-container *ngIf="sortBy?.key === 'service'">
<digi-icon-caret-up class="participants-list__sort-icon" *ngIf="!sortBy.reverse"></digi-icon-caret-up>
<digi-icon-caret-down class="participants-list__sort-icon" *ngIf="sortBy.reverse"></digi-icon-caret-down>
</ng-container>
</button>
</th>
<th scope="col" class="participants-list__column-head">
<button class="participants-list__sort-button" (click)="handleSort('startDate')">
Startdatum
<ng-container *ngIf="sortBy?.key === 'startDate'">
<digi-icon-caret-up class="participants-list__sort-icon" *ngIf="!sortBy.reverse"></digi-icon-caret-up>
<digi-icon-caret-down class="participants-list__sort-icon" *ngIf="sortBy.reverse"></digi-icon-caret-down>
</ng-container>
</button>
</th>
<th scope="col" class="participants-list__column-head">
<button class="participants-list__sort-button" (click)="handleSort('endDate')">
Slutdatum
<ng-container *ngIf="sortBy?.key === 'endDate'">
<digi-icon-caret-up class="participants-list__sort-icon" *ngIf="!sortBy.reverse"></digi-icon-caret-up>
<digi-icon-caret-down class="participants-list__sort-icon" *ngIf="sortBy.reverse"></digi-icon-caret-down>
</ng-container>
</button>
</th>
<th scope="col" class="participants-list__column-head">
<button class="participants-list__sort-button" (click)="handleSort('handleBefore')">
Hantera innan
<ng-container *ngIf="sortBy?.key === 'handleBefore'">
<digi-icon-caret-up class="participants-list__sort-icon" *ngIf="!sortBy.reverse"></digi-icon-caret-up>
<digi-icon-caret-down class="participants-list__sort-icon" *ngIf="sortBy.reverse"></digi-icon-caret-down>
</ng-container>
</button>
</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -16,6 +65,7 @@
<td>{{ participant.service }}</td> <td>{{ participant.service }}</td>
<td>{{ participant.startDate | date: 'yyyy-MM-dd' }}</td> <td>{{ participant.startDate | date: 'yyyy-MM-dd' }}</td>
<td>{{ participant.endDate | date: 'yyyy-MM-dd' }}</td> <td>{{ participant.endDate | date: 'yyyy-MM-dd' }}</td>
<td>{{ participant.handleBefore | date: 'yyyy-MM-dd' }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@@ -0,0 +1,30 @@
@import 'variables/gutters';
.participants-list {
&__column-head {
padding: 0;
}
&__sort-button {
position: relative;
background-color: transparent;
border-width: 0;
width: 100%;
text-align: left;
padding: var(--digi--layout--gutter--s) $digi--layout--gutter--l var(--digi--layout--gutter--s)
var(--digi--layout--gutter);
margin: 0;
font-size: inherit;
font-weight: inherit;
display: flex;
align-items: center;
gap: var(--digi--layout--gutter);
cursor: pointer;
}
&__sort-icon {
position: absolute;
display: inline-flex;
right: 0.5rem;
}
}

View File

@@ -1,5 +1,7 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { Participant } from '@dafa-models/participant.model'; import { Participant } from '@dafa-models/participant.model';
import { SortBy } from '@dafa-models/sort-by.model';
import { ParticipantsService } from '@dafa-services/api/participants.service';
@Component({ @Component({
selector: 'dafa-participants-list', selector: 'dafa-participants-list',
@@ -9,4 +11,11 @@ import { Participant } from '@dafa-models/participant.model';
}) })
export class ParticipantsListComponent { export class ParticipantsListComponent {
@Input() participants: Participant[]; @Input() participants: Participant[];
@Input() sortBy: SortBy | null;
constructor(private participantsService: ParticipantsService) {}
handleSort(key: keyof Participant): void {
this.participantsService.setSortKey(key);
}
} }

View File

@@ -19,6 +19,7 @@
<dafa-participants-list <dafa-participants-list
*ngIf="participants$ | async as participants; else loadingRef" *ngIf="participants$ | async as participants; else loadingRef"
[participants]="participants" [participants]="participants"
[sortBy]="sortBy$ | async"
></dafa-participants-list> ></dafa-participants-list>
<ng-template #loadingRef> <ng-template #loadingRef>

View File

@@ -1,5 +1,6 @@
import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Participant } from '@dafa-models/participant.model'; import { Participant } from '@dafa-models/participant.model';
import { SortBy } from '@dafa-models/sort-by.model';
import { ParticipantsService } from '@dafa-services/api/participants.service'; import { ParticipantsService } from '@dafa-services/api/participants.service';
import { BehaviorSubject, Observable } from 'rxjs'; import { BehaviorSubject, Observable } from 'rxjs';
@@ -12,6 +13,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
export class ParticipantsComponent { export class ParticipantsComponent {
private _searchValue$ = new BehaviorSubject<string>(''); private _searchValue$ = new BehaviorSubject<string>('');
participants$: Observable<Participant[]> = this.participantsService.participants$; participants$: Observable<Participant[]> = this.participantsService.participants$;
sortBy$: Observable<SortBy | null> = this.participantsService.sortBy$;
constructor(private participantsService: ParticipantsService) {} constructor(private participantsService: ParticipantsService) {}
@@ -20,7 +22,7 @@ export class ParticipantsComponent {
} }
handleSearchSubmit(): void { handleSearchSubmit(): void {
console.log(this.searchValue); this.participantsService.setSearchFilter(this.searchValue);
} }
handleSearchInput($event: CustomEvent): void { handleSearchInput($event: CustomEvent): void {

View File

@@ -10,26 +10,51 @@ import { map } from 'rxjs/operators';
providedIn: 'root', providedIn: 'root',
}) })
export class ParticipantsService { export class ParticipantsService {
private _participants$: Observable<Participant[]> = this.httpClient.get<Participant[]>( private _participants$: Observable<Participant[]> = this.httpClient
`${environment.apiBase}/participants` .get<Participant[]>(`${environment.apiBase}/participants`)
); .pipe(
private _sortBy$ = new BehaviorSubject<SortBy | null>({ key: 'service', reverse: false }); map(participants =>
participants.map(participant => ({
...participant,
fullName: `${participant.firstName} ${participant.lastName}`,
}))
)
);
private _sortBy$ = new BehaviorSubject<SortBy | null>({ key: 'handleBefore', reverse: false });
public sortBy$: Observable<SortBy> = this._sortBy$.asObservable(); public sortBy$: Observable<SortBy> = this._sortBy$.asObservable();
private _searchFilter$ = new BehaviorSubject<string>('');
public searchFilter$: Observable<string> = this._searchFilter$.asObservable();
public participants$: Observable<Participant[]> = combineLatest([
this._sortBy$,
this._participants$,
this._searchFilter$,
]).pipe(
map(([sortBy, participants, searchFilter]) => {
const filteredParticipants = participants.filter(participant => {
const searchValueExistsInName = participant.fullName.toLowerCase().includes(searchFilter.toLowerCase());
const searchValueExistsInErrandNumber = participant.errandNumber.toString().includes(searchFilter);
return searchValueExistsInName || searchValueExistsInErrandNumber;
});
public participants$: Observable<Participant[]> = combineLatest([this._sortBy$, this._participants$]).pipe(
map(([sortBy, participants]) => {
if (sortBy) { if (sortBy) {
const reverse = sortBy.reverse ? -1 : 1; const reverse = sortBy.reverse ? -1 : 1;
return [...participants].sort((a, b) => { return [...filteredParticipants].sort((a, b) => {
const first = a[sortBy.key]; const first = a[sortBy.key];
const second = b[sortBy.key]; const second = b[sortBy.key];
return reverse * +(first > second) - +(second > first);
return reverse * (+(first > second) - +(second > first));
}); });
} }
return participants; return participants;
}) })
); );
public setSearchFilter(value: string) {
this._searchFilter$.next(value);
}
public setSortKey(key: keyof Participant) { public setSortKey(key: keyof Participant) {
const currentSortBy = this._sortBy$.getValue(); const currentSortBy = this._sortBy$.getValue();
let reverse = false; let reverse = false;

View File

@@ -17,10 +17,19 @@ body {
font-weight: var(--digi--typography--font-weight); font-weight: var(--digi--typography--font-weight);
} }
button {
font-family: var(--digi--typography--font-family);
}
strong { strong {
font-weight: var(--digi--typography--font-weight--semibold); font-weight: var(--digi--typography--font-weight--semibold);
} }
// Make all digi icons display inline-flex to make them get the correct height.
[class^='sc-digi-icon'] {
display: inline-flex;
}
.dafa { .dafa {
&__a11y-sr-only { &__a11y-sr-only {
@include dafa__a11y-sr-only; @include dafa__a11y-sr-only;

View File

@@ -2,462 +2,513 @@
"participants": [ "participants": [
{ {
"id": 0, "id": 0,
"firstName": "Lue", "firstName": "Zachariah",
"lastName": "Johansson", "lastName": "Gustafsson",
"service": "KROM", "service": "KROM",
"errandNumber": 510157, "errandNumber": 536849,
"startDate": "2021-03-24T06:46:25.453Z", "startDate": "2021-03-29T03:35:58.817Z",
"endDate": "2021-03-25T03:46:37.738Z" "endDate": "2021-12-30T13:16:57.069Z",
"handleBefore": "2021-03-30T04:28:41.898Z"
}, },
{ {
"id": 1, "id": 1,
"firstName": "Jaeden", "firstName": "Lane",
"lastName": "Eriksson", "lastName": "Olsson",
"service": "STOM", "service": "KVL",
"errandNumber": 377736, "errandNumber": 567126,
"startDate": "2021-03-24T01:27:49.701Z", "startDate": "2021-03-28T09:59:48.777Z",
"endDate": "2021-03-25T09:49:30.060Z" "endDate": "2022-03-18T16:18:38.242Z",
"handleBefore": "2021-03-29T09:45:03.024Z"
}, },
{ {
"id": 2, "id": 2,
"firstName": "Stanford", "firstName": "Desmond",
"lastName": "Persson", "lastName": "Nilsson",
"service": "STOM", "service": "STOM",
"errandNumber": 248457, "errandNumber": 438670,
"startDate": "2021-03-23T20:24:08.131Z", "startDate": "2021-03-28T20:16:58.352Z",
"endDate": "2021-03-24T18:39:44.497Z" "endDate": "2021-08-14T12:52:17.152Z",
"handleBefore": "2021-03-29T15:16:38.831Z"
}, },
{ {
"id": 3, "id": 3,
"firstName": "Asa", "firstName": "Joyce",
"lastName": "Johansson", "lastName": "Persson",
"service": "STOM", "service": "STOM",
"errandNumber": 610178, "errandNumber": 487945,
"startDate": "2021-03-23T22:18:31.880Z", "startDate": "2021-03-29T01:45:42.364Z",
"endDate": "2021-03-25T12:44:26.802Z" "endDate": "2021-04-28T05:27:50.553Z",
"handleBefore": "2021-03-29T12:28:42.680Z"
}, },
{ {
"id": 4, "id": 4,
"firstName": "Deondre", "firstName": "Kasandra",
"lastName": "Persson", "lastName": "Karlsson",
"service": "STOM", "service": "KVL",
"errandNumber": 355138, "errandNumber": 803191,
"startDate": "2021-03-23T20:05:52.524Z", "startDate": "2021-03-28T22:58:56.665Z",
"endDate": "2021-03-25T09:54:38.084Z" "endDate": "2021-07-20T12:24:55.428Z",
"handleBefore": "2021-03-29T19:19:09.039Z"
}, },
{ {
"id": 5, "id": 5,
"firstName": "Myrtle", "firstName": "Crystal",
"lastName": "Andersson", "lastName": "Gustafsson",
"service": "STOM", "service": "STOM",
"errandNumber": 883673, "errandNumber": 618306,
"startDate": "2021-03-24T10:52:18.953Z", "startDate": "2021-03-29T04:36:23.159Z",
"endDate": "2021-03-25T05:56:14.101Z" "endDate": "2022-02-05T20:19:50.325Z",
"handleBefore": "2021-03-29T20:46:28.338Z"
}, },
{ {
"id": 6, "id": 6,
"firstName": "Maribel", "firstName": "Dino",
"lastName": "Karlsson", "lastName": "Persson",
"service": "KVL", "service": "KROM",
"errandNumber": 543298, "errandNumber": 747042,
"startDate": "2021-03-23T23:04:27.274Z", "startDate": "2021-03-28T23:31:14.203Z",
"endDate": "2021-03-25T04:46:18.733Z" "endDate": "2021-11-05T04:37:14.244Z",
"handleBefore": "2021-03-30T06:46:18.982Z"
}, },
{ {
"id": 7, "id": 7,
"firstName": "Garnett", "firstName": "Clarabelle",
"lastName": "Andersson", "lastName": "Persson",
"service": "KROM", "service": "KVL",
"errandNumber": 181871, "errandNumber": 840619,
"startDate": "2021-03-24T01:25:13.067Z", "startDate": "2021-03-28T12:41:19.758Z",
"endDate": "2021-03-24T23:28:06.677Z" "endDate": "2021-12-12T10:47:21.005Z",
"handleBefore": "2021-03-29T17:58:23.043Z"
}, },
{ {
"id": 8, "id": 8,
"firstName": "Felix", "firstName": "Kelley",
"lastName": "Persson", "lastName": "Larsson",
"service": "KVL", "service": "KROM",
"errandNumber": 667535, "errandNumber": 759971,
"startDate": "2021-03-23T23:13:09.457Z", "startDate": "2021-03-29T01:35:07.331Z",
"endDate": "2021-03-24T21:48:33.918Z" "endDate": "2021-05-11T05:56:37.947Z",
"handleBefore": "2021-03-29T22:56:29.566Z"
}, },
{ {
"id": 9, "id": 9,
"firstName": "Crystal", "firstName": "Noemy",
"lastName": "Gustafsson", "lastName": "Eriksson",
"service": "KROM", "service": "STOM",
"errandNumber": 900214, "errandNumber": 733022,
"startDate": "2021-03-24T10:10:24.519Z", "startDate": "2021-03-28T17:33:07.590Z",
"endDate": "2021-03-24T18:54:36.626Z" "endDate": "2022-03-28T11:57:02.399Z",
"handleBefore": "2021-03-29T18:40:48.693Z"
}, },
{ {
"id": 10, "id": 10,
"firstName": "Elyssa", "firstName": "Camryn",
"lastName": "Johansson", "lastName": "Larsson",
"service": "STOM", "service": "KVL",
"errandNumber": 622870, "errandNumber": 975949,
"startDate": "2021-03-23T15:20:51.528Z", "startDate": "2021-03-29T05:44:22.261Z",
"endDate": "2021-03-24T22:28:35.177Z" "endDate": "2021-07-01T07:11:45.448Z",
"handleBefore": "2021-03-29T08:34:21.991Z"
}, },
{ {
"id": 11, "id": 11,
"firstName": "Vivienne", "firstName": "Susanna",
"lastName": "Larsson", "lastName": "Gustafsson",
"service": "STOM", "service": "KVL",
"errandNumber": 859592, "errandNumber": 633058,
"startDate": "2021-03-24T11:33:18.907Z", "startDate": "2021-03-28T09:55:34.767Z",
"endDate": "2021-03-24T18:33:13.229Z" "endDate": "2021-12-24T16:16:54.023Z",
"handleBefore": "2021-03-29T22:46:14.021Z"
}, },
{ {
"id": 12, "id": 12,
"firstName": "Joyce", "firstName": "Charlotte",
"lastName": "Karlsson", "lastName": "Eriksson",
"service": "KVL", "service": "KROM",
"errandNumber": 538461, "errandNumber": 274938,
"startDate": "2021-03-24T01:08:08.322Z", "startDate": "2021-03-29T07:24:08.879Z",
"endDate": "2021-03-24T16:38:08.640Z" "endDate": "2022-03-12T12:50:47.862Z",
"handleBefore": "2021-03-29T19:07:36.447Z"
}, },
{ {
"id": 13, "id": 13,
"firstName": "Tressie", "firstName": "Malcolm",
"lastName": "Larsson", "lastName": "Persson",
"service": "KVL", "service": "KROM",
"errandNumber": 898416, "errandNumber": 700835,
"startDate": "2021-03-24T12:03:35.746Z", "startDate": "2021-03-28T12:21:10.957Z",
"endDate": "2021-03-25T07:50:31.027Z" "endDate": "2021-08-09T00:09:38.945Z",
"handleBefore": "2021-03-29T16:50:18.821Z"
}, },
{ {
"id": 14, "id": 14,
"firstName": "Destany", "firstName": "Marisa",
"lastName": "Nilsson", "lastName": "Nilsson",
"service": "KROM", "service": "KVL",
"errandNumber": 108382, "errandNumber": 720806,
"startDate": "2021-03-24T12:19:05.009Z", "startDate": "2021-03-28T14:52:48.860Z",
"endDate": "2021-03-24T15:18:58.854Z" "endDate": "2021-10-22T18:06:19.433Z",
"handleBefore": "2021-03-29T12:48:49.611Z"
}, },
{ {
"id": 15, "id": 15,
"firstName": "Amparo", "firstName": "Naomi",
"lastName": "Svensson", "lastName": "Andersson",
"service": "KVL", "service": "KROM",
"errandNumber": 575430, "errandNumber": 117130,
"startDate": "2021-03-23T21:21:53.958Z", "startDate": "2021-03-28T08:43:04.765Z",
"endDate": "2021-03-25T05:38:56.819Z" "endDate": "2022-03-24T09:03:55.824Z",
"handleBefore": "2021-03-29T20:18:05.130Z"
}, },
{ {
"id": 16, "id": 16,
"firstName": "Raheem", "firstName": "Dion",
"lastName": "Andersson", "lastName": "Eriksson",
"service": "KVL", "service": "STOM",
"errandNumber": 953559, "errandNumber": 345480,
"startDate": "2021-03-24T06:15:15.728Z", "startDate": "2021-03-28T12:17:25.708Z",
"endDate": "2021-03-25T04:23:02.270Z" "endDate": "2021-09-28T12:10:52.671Z",
"handleBefore": "2021-03-29T17:42:58.460Z"
}, },
{ {
"id": 17, "id": 17,
"firstName": "Alanna", "firstName": "Brody",
"lastName": "Nilsson", "lastName": "Johansson",
"service": "KVL", "service": "STOM",
"errandNumber": 293773, "errandNumber": 733022,
"startDate": "2021-03-23T16:13:40.239Z", "startDate": "2021-03-28T18:35:38.651Z",
"endDate": "2021-03-25T02:56:10.174Z" "endDate": "2021-05-17T12:34:03.549Z",
"handleBefore": "2021-03-29T12:31:34.183Z"
}, },
{ {
"id": 18, "id": 18,
"firstName": "Sebastian", "firstName": "Luisa",
"lastName": "Johansson", "lastName": "Svensson",
"service": "KVL", "service": "KROM",
"errandNumber": 284762, "errandNumber": 824872,
"startDate": "2021-03-24T09:19:22.596Z", "startDate": "2021-03-28T08:31:02.690Z",
"endDate": "2021-03-24T20:59:24.571Z" "endDate": "2022-03-05T15:55:07.194Z",
"handleBefore": "2021-03-30T06:12:51.675Z"
}, },
{ {
"id": 19, "id": 19,
"firstName": "Gianni", "firstName": "Adrian",
"lastName": "Andersson", "lastName": "Johansson",
"service": "KVL", "service": "KVL",
"errandNumber": 131231, "errandNumber": 525875,
"startDate": "2021-03-24T01:55:19.500Z", "startDate": "2021-03-28T15:00:30.790Z",
"endDate": "2021-03-25T06:01:58.361Z" "endDate": "2021-12-16T21:06:46.317Z",
"handleBefore": "2021-03-29T11:53:52.678Z"
}, },
{ {
"id": 20, "id": 20,
"firstName": "Jamarcus", "firstName": "Eric",
"lastName": "Nilsson", "lastName": "Andersson",
"service": "KROM", "service": "KVL",
"errandNumber": 524071, "errandNumber": 197879,
"startDate": "2021-03-24T00:12:52.690Z", "startDate": "2021-03-28T18:38:22.793Z",
"endDate": "2021-03-25T04:38:04.578Z" "endDate": "2021-09-20T17:47:21.243Z",
"handleBefore": "2021-03-29T11:24:02.884Z"
}, },
{ {
"id": 21, "id": 21,
"firstName": "Shane", "firstName": "Imelda",
"lastName": "Gustafsson", "lastName": "Nilsson",
"service": "KROM", "service": "STOM",
"errandNumber": 419503, "errandNumber": 889134,
"startDate": "2021-03-24T10:38:23.132Z", "startDate": "2021-03-29T06:25:32.344Z",
"endDate": "2021-03-24T16:28:05.829Z" "endDate": "2021-08-24T18:30:44.496Z",
"handleBefore": "2021-03-29T12:53:13.009Z"
}, },
{ {
"id": 22, "id": 22,
"firstName": "Quincy", "firstName": "Domenick",
"lastName": "Andersson", "lastName": "Johansson",
"service": "STOM", "service": "KROM",
"errandNumber": 980668, "errandNumber": 907567,
"startDate": "2021-03-24T03:39:34.264Z", "startDate": "2021-03-29T05:55:01.203Z",
"endDate": "2021-03-25T11:33:03.528Z" "endDate": "2021-12-13T04:53:58.357Z",
"handleBefore": "2021-03-29T08:08:40.717Z"
}, },
{ {
"id": 23, "id": 23,
"firstName": "Albert", "firstName": "Connor",
"lastName": "Gustafsson", "lastName": "Olsson",
"service": "KVL", "service": "KVL",
"errandNumber": 255681, "errandNumber": 119431,
"startDate": "2021-03-24T13:16:53.973Z", "startDate": "2021-03-29T06:27:18.505Z",
"endDate": "2021-03-24T16:15:13.331Z" "endDate": "2021-12-23T09:46:40.014Z",
"handleBefore": "2021-03-29T19:50:17.445Z"
}, },
{ {
"id": 24, "id": 24,
"firstName": "Zachary", "firstName": "Ceasar",
"lastName": "Persson", "lastName": "Eriksson",
"service": "STOM", "service": "STOM",
"errandNumber": 235443, "errandNumber": 461247,
"startDate": "2021-03-23T23:22:43.032Z", "startDate": "2021-03-28T17:57:54.869Z",
"endDate": "2021-03-24T22:32:22.796Z" "endDate": "2022-03-12T03:31:12.605Z",
"handleBefore": "2021-03-30T03:13:10.115Z"
}, },
{ {
"id": 25, "id": 25,
"firstName": "Alvah", "firstName": "Kacey",
"lastName": "Nilsson", "lastName": "Svensson",
"service": "KVL", "service": "STOM",
"errandNumber": 991483, "errandNumber": 447832,
"startDate": "2021-03-24T10:53:18.979Z", "startDate": "2021-03-28T10:07:40.693Z",
"endDate": "2021-03-25T13:40:56.956Z" "endDate": "2022-01-15T15:16:33.983Z",
"handleBefore": "2021-03-29T22:47:15.698Z"
}, },
{ {
"id": 26, "id": 26,
"firstName": "Royce", "firstName": "Moshe",
"lastName": "Karlsson", "lastName": "Svensson",
"service": "KVL", "service": "KROM",
"errandNumber": 110233, "errandNumber": 183189,
"startDate": "2021-03-23T14:15:49.310Z", "startDate": "2021-03-28T12:07:57.729Z",
"endDate": "2021-03-24T22:10:20.264Z" "endDate": "2022-02-12T01:22:42.084Z",
"handleBefore": "2021-03-30T06:53:20.641Z"
}, },
{ {
"id": 27, "id": 27,
"firstName": "Natasha", "firstName": "Dexter",
"lastName": "Olsson", "lastName": "Larsson",
"service": "STOM", "service": "KROM",
"errandNumber": 773071, "errandNumber": 936851,
"startDate": "2021-03-24T08:10:36.267Z", "startDate": "2021-03-28T20:51:25.418Z",
"endDate": "2021-03-24T16:09:08.636Z" "endDate": "2021-08-02T23:04:59.337Z",
"handleBefore": "2021-03-29T17:56:43.768Z"
}, },
{ {
"id": 28, "id": 28,
"firstName": "Ernesto", "firstName": "Waino",
"lastName": "Persson", "lastName": "Andersson",
"service": "KROM", "service": "KROM",
"errandNumber": 120695, "errandNumber": 321404,
"startDate": "2021-03-24T00:47:04.814Z", "startDate": "2021-03-28T15:23:11.190Z",
"endDate": "2021-03-24T22:59:49.253Z" "endDate": "2021-09-05T17:48:33.661Z",
"handleBefore": "2021-03-30T05:13:00.841Z"
}, },
{ {
"id": 29, "id": 29,
"firstName": "Stefanie", "firstName": "Hilma",
"lastName": "Johansson", "lastName": "Olsson",
"service": "STOM", "service": "KROM",
"errandNumber": 413726, "errandNumber": 587769,
"startDate": "2021-03-23T16:48:44.204Z", "startDate": "2021-03-28T23:09:30.690Z",
"endDate": "2021-03-24T16:12:52.991Z" "endDate": "2021-05-29T07:29:27.511Z",
"handleBefore": "2021-03-30T05:26:06.647Z"
}, },
{ {
"id": 30, "id": 30,
"firstName": "Foster", "firstName": "Kian",
"lastName": "Larsson", "lastName": "Gustafsson",
"service": "KVL", "service": "KVL",
"errandNumber": 653702, "errandNumber": 383043,
"startDate": "2021-03-23T17:53:17.006Z", "startDate": "2021-03-29T00:48:54.562Z",
"endDate": "2021-03-24T16:05:40.969Z" "endDate": "2021-04-05T02:54:00.526Z",
"handleBefore": "2021-03-29T15:27:12.367Z"
}, },
{ {
"id": 31, "id": 31,
"firstName": "Seth", "firstName": "Noemie",
"lastName": "Johansson", "lastName": "Olsson",
"service": "KVL", "service": "STOM",
"errandNumber": 123533, "errandNumber": 724307,
"startDate": "2021-03-23T22:14:12.564Z", "startDate": "2021-03-28T19:36:43.720Z",
"endDate": "2021-03-24T20:21:11.527Z" "endDate": "2022-01-01T22:02:32.595Z",
"handleBefore": "2021-03-29T15:54:14.762Z"
}, },
{ {
"id": 32, "id": 32,
"firstName": "Jo", "firstName": "Orion",
"lastName": "Svensson", "lastName": "Karlsson",
"service": "KVL", "service": "STOM",
"errandNumber": 804437, "errandNumber": 769355,
"startDate": "2021-03-24T08:10:37.878Z", "startDate": "2021-03-28T22:47:10.414Z",
"endDate": "2021-03-25T10:11:45.765Z" "endDate": "2021-12-08T11:25:16.821Z",
"handleBefore": "2021-03-30T03:33:35.963Z"
}, },
{ {
"id": 33, "id": 33,
"firstName": "Ariane", "firstName": "Darien",
"lastName": "Eriksson", "lastName": "Gustafsson",
"service": "KROM", "service": "KVL",
"errandNumber": 406681, "errandNumber": 795437,
"startDate": "2021-03-24T01:55:15.813Z", "startDate": "2021-03-28T14:25:41.788Z",
"endDate": "2021-03-25T00:33:13.044Z" "endDate": "2021-12-06T17:25:40.528Z",
"handleBefore": "2021-03-29T22:52:14.772Z"
}, },
{ {
"id": 34, "id": 34,
"firstName": "Ephraim", "firstName": "Bailee",
"lastName": "Johansson", "lastName": "Nilsson",
"service": "STOM", "service": "STOM",
"errandNumber": 248741, "errandNumber": 917438,
"startDate": "2021-03-24T02:16:10.768Z", "startDate": "2021-03-29T02:16:23.343Z",
"endDate": "2021-03-25T07:01:40.677Z" "endDate": "2021-07-13T20:37:09.622Z",
"handleBefore": "2021-03-29T15:38:25.945Z"
}, },
{ {
"id": 35, "id": 35,
"firstName": "Dee", "firstName": "Hulda",
"lastName": "Olsson", "lastName": "Nilsson",
"service": "STOM", "service": "KROM",
"errandNumber": 357775, "errandNumber": 283560,
"startDate": "2021-03-24T10:15:56.279Z", "startDate": "2021-03-29T03:24:53.913Z",
"endDate": "2021-03-25T13:00:01.488Z" "endDate": "2021-04-01T09:23:16.957Z",
"handleBefore": "2021-03-30T00:49:08.645Z"
}, },
{ {
"id": 36, "id": 36,
"firstName": "Aron", "firstName": "Callie",
"lastName": "Eriksson", "lastName": "Andersson",
"service": "STOM", "service": "KROM",
"errandNumber": 860839, "errandNumber": 432061,
"startDate": "2021-03-23T20:54:20.294Z", "startDate": "2021-03-28T13:49:03.976Z",
"endDate": "2021-03-24T16:10:01.281Z" "endDate": "2021-12-04T13:55:16.348Z",
"handleBefore": "2021-03-30T04:13:17.975Z"
}, },
{ {
"id": 37, "id": 37,
"firstName": "Reynold", "firstName": "Alejandra",
"lastName": "Svensson", "lastName": "Johansson",
"service": "STOM", "service": "KVL",
"errandNumber": 862554, "errandNumber": 362300,
"startDate": "2021-03-23T18:02:14.687Z", "startDate": "2021-03-28T09:03:17.100Z",
"endDate": "2021-03-25T08:22:51.045Z" "endDate": "2021-04-23T15:28:05.292Z",
"handleBefore": "2021-03-29T19:41:07.119Z"
}, },
{ {
"id": 38, "id": 38,
"firstName": "Emanuel", "firstName": "Jovanny",
"lastName": "Olsson", "lastName": "Persson",
"service": "KVL", "service": "KROM",
"errandNumber": 765311, "errandNumber": 886469,
"startDate": "2021-03-24T04:01:26.883Z", "startDate": "2021-03-28T16:25:50.440Z",
"endDate": "2021-03-24T18:01:10.758Z" "endDate": "2021-10-19T13:14:28.723Z",
"handleBefore": "2021-03-29T21:16:42.820Z"
}, },
{ {
"id": 39, "id": 39,
"firstName": "Marco", "firstName": "Josiah",
"lastName": "Eriksson", "lastName": "Eriksson",
"service": "KROM", "service": "STOM",
"errandNumber": 760265, "errandNumber": 699471,
"startDate": "2021-03-24T08:27:30.962Z", "startDate": "2021-03-28T18:14:02.241Z",
"endDate": "2021-03-25T05:04:10.669Z" "endDate": "2022-01-19T14:09:03.796Z",
"handleBefore": "2021-03-29T13:24:02.164Z"
}, },
{ {
"id": 40, "id": 40,
"firstName": "Deanna", "firstName": "Demond",
"lastName": "Larsson", "lastName": "Olsson",
"service": "STOM", "service": "KVL",
"errandNumber": 769850, "errandNumber": 758645,
"startDate": "2021-03-24T09:21:33.805Z", "startDate": "2021-03-28T11:11:49.947Z",
"endDate": "2021-03-25T07:50:32.169Z" "endDate": "2021-04-25T15:44:07.973Z",
"handleBefore": "2021-03-30T05:52:23.896Z"
}, },
{ {
"id": 41, "id": 41,
"firstName": "Jeffry", "firstName": "Rachael",
"lastName": "Svensson", "lastName": "Larsson",
"service": "STOM", "service": "KVL",
"errandNumber": 864535, "errandNumber": 213883,
"startDate": "2021-03-23T18:34:56.980Z", "startDate": "2021-03-28T13:48:26.872Z",
"endDate": "2021-03-25T04:20:36.484Z" "endDate": "2021-08-11T14:50:26.845Z",
"handleBefore": "2021-03-30T06:14:28.062Z"
}, },
{ {
"id": 42, "id": 42,
"firstName": "Rosa", "firstName": "Hank",
"lastName": "Persson", "lastName": "Gustafsson",
"service": "KROM", "service": "STOM",
"errandNumber": 605416, "errandNumber": 317122,
"startDate": "2021-03-24T05:31:06.285Z", "startDate": "2021-03-29T02:03:12.368Z",
"endDate": "2021-03-25T08:32:14.905Z" "endDate": "2021-04-06T13:41:00.314Z",
"handleBefore": "2021-03-30T06:04:08.036Z"
}, },
{ {
"id": 43, "id": 43,
"firstName": "Gail", "firstName": "Jamaal",
"lastName": "Larsson", "lastName": "Persson",
"service": "KROM", "service": "KROM",
"errandNumber": 683500, "errandNumber": 254985,
"startDate": "2021-03-24T02:42:36.756Z", "startDate": "2021-03-28T22:09:50.067Z",
"endDate": "2021-03-25T07:10:42.685Z" "endDate": "2021-08-14T16:06:06.014Z",
"handleBefore": "2021-03-30T03:20:43.517Z"
}, },
{ {
"id": 44, "id": 44,
"firstName": "Scot", "firstName": "Lulu",
"lastName": "Karlsson", "lastName": "Andersson",
"service": "STOM", "service": "KVL",
"errandNumber": 123534, "errandNumber": 698835,
"startDate": "2021-03-23T15:51:54.993Z", "startDate": "2021-03-29T05:26:47.608Z",
"endDate": "2021-03-25T13:53:14.385Z" "endDate": "2021-08-07T06:49:21.202Z",
"handleBefore": "2021-03-30T04:42:36.097Z"
}, },
{ {
"id": 45, "id": 45,
"firstName": "Kylee", "firstName": "Brianne",
"lastName": "Karlsson", "lastName": "Nilsson",
"service": "KROM", "service": "KROM",
"errandNumber": 506523, "errandNumber": 410723,
"startDate": "2021-03-24T01:35:28.281Z", "startDate": "2021-03-28T23:58:34.372Z",
"endDate": "2021-03-24T14:30:57.283Z" "endDate": "2021-09-18T19:31:33.334Z",
"handleBefore": "2021-03-29T16:21:08.880Z"
}, },
{ {
"id": 46, "id": 46,
"firstName": "Trystan", "firstName": "Rhoda",
"lastName": "Olsson", "lastName": "Gustafsson",
"service": "KVL", "service": "STOM",
"errandNumber": 172236, "errandNumber": 249730,
"startDate": "2021-03-23T15:08:14.955Z", "startDate": "2021-03-28T09:56:22.796Z",
"endDate": "2021-03-25T12:28:55.169Z" "endDate": "2021-11-08T09:52:39.151Z",
"handleBefore": "2021-03-30T03:57:05.253Z"
}, },
{ {
"id": 47, "id": 47,
"firstName": "Lilian", "firstName": "Irwin",
"lastName": "Persson", "lastName": "Eriksson",
"service": "STOM", "service": "STOM",
"errandNumber": 353928, "errandNumber": 395606,
"startDate": "2021-03-24T04:51:58.678Z", "startDate": "2021-03-28T10:58:36.254Z",
"endDate": "2021-03-25T00:08:42.488Z" "endDate": "2021-09-26T01:53:29.905Z",
"handleBefore": "2021-03-30T07:13:37.504Z"
}, },
{ {
"id": 48, "id": 48,
"firstName": "Carolyne", "firstName": "Candido",
"lastName": "Eriksson", "lastName": "Larsson",
"service": "STOM", "service": "KROM",
"errandNumber": 311376, "errandNumber": 805048,
"startDate": "2021-03-24T13:20:52.046Z", "startDate": "2021-03-29T03:00:50.863Z",
"endDate": "2021-03-25T10:48:58.199Z" "endDate": "2021-06-08T23:53:39.404Z",
"handleBefore": "2021-03-29T20:01:49.405Z"
}, },
{ {
"id": 49, "id": 49,
"firstName": "Aniya", "firstName": "Tyshawn",
"lastName": "Persson", "lastName": "Karlsson",
"service": "KROM", "service": "STOM",
"errandNumber": 817121, "errandNumber": 220243,
"startDate": "2021-03-23T15:57:10.245Z", "startDate": "2021-03-28T17:38:49.230Z",
"endDate": "2021-03-24T21:08:49.518Z" "endDate": "2021-05-01T21:05:19.336Z",
"handleBefore": "2021-03-29T23:20:30.570Z"
}, },
{ {
"id": 50, "id": 50,
"firstName": "Kristina", "firstName": "Gudrun",
"lastName": "Gustafsson", "lastName": "Eriksson",
"service": "KVL", "service": "STOM",
"errandNumber": 941697, "errandNumber": 227839,
"startDate": "2021-03-23T20:22:25.326Z", "startDate": "2021-03-28T23:01:57.736Z",
"endDate": "2021-03-25T05:32:47.175Z" "endDate": "2021-07-19T04:13:07.539Z",
"handleBefore": "2021-03-29T23:36:23.397Z"
} }
] ]
} }

View File

@@ -15,7 +15,8 @@ function generateParticipants(amount = 10) {
service: AVAILABLE_SERVICES[Math.floor(Math.random() * AVAILABLE_SERVICES.length)], service: AVAILABLE_SERVICES[Math.floor(Math.random() * AVAILABLE_SERVICES.length)],
errandNumber: faker.random.number({ min: 100000, max: 999999 }), errandNumber: faker.random.number({ min: 100000, max: 999999 }),
startDate: faker.date.recent(), startDate: faker.date.recent(),
endDate: faker.date.soon(), endDate: faker.date.future(),
handleBefore: faker.date.soon(),
}); });
} }