-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata.js
More file actions
70 lines (65 loc) · 2.33 KB
/
data.js
File metadata and controls
70 lines (65 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import vaccines from './datasets/vaccines.js'
import batches from '../.data/batches.json' with { type: 'json' }
import clinicAppointments from '../.data/clinic-appointments.json' with { type: 'json' }
import clinicBookings from '../.data/clinic-bookings.json' with { type: 'json' }
import clinics from '../.data/clinics.json' with { type: 'json' }
import instructions from '../.data/instructions.json' with { type: 'json' }
import moves from '../.data/moves.json' with { type: 'json' }
import notices from '../.data/notices.json' with { type: 'json' }
import patients from '../.data/patients.json' with { type: 'json' }
import patientSessions from '../.data/patient-sessions.json' with { type: 'json' }
import pdsRecords from '../.data/pds-records.json' with { type: 'json' }
import programmes from '../.data/programmes.json' with { type: 'json' }
import replies from '../.data/replies.json' with { type: 'json' }
import schools from '../.data/schools.json' with { type: 'json' }
import sessions from '../.data/sessions.json' with { type: 'json' }
import teams from '../.data/teams.json' with { type: 'json' }
import uploads from '../.data/uploads.json' with { type: 'json' }
import users from '../.data/users.json' with { type: 'json' }
import vaccinations from '../.data/vaccinations.json' with { type: 'json' }
import { Consent, Move, Notice, Session } from './models.js'
// Use Coventry and Warwickshire as team
const team = teams['001']
/**
* Default values for user session data
*
* These are automatically added via the `autoStoreData` middleware. A values
* will only be added to the session if it doesn't already exist. This may be
* useful for testing journeys where users are returning or logging in to an
* existing application.
*/
const data = {
batches,
clinicAppointments,
clinicBookings,
clinics,
counts: {},
defaultBatches: {},
downloads: {},
features: {},
instructions,
moves,
notices,
patients,
patientSessions,
pdsRecords,
programmes,
replies,
schools,
sessions,
team,
teams,
uploads,
users,
vaccinations,
vaccines,
wizard: {}
}
// Statistics
data.counts.consents = Consent.findAll(data).length
data.counts.moves = Move.findAll(data).length
data.counts.notices = Notice.findAll(data).filter(
({ archivedAt }) => !archivedAt
).length
data.counts.sessions = Session.findAll(data).length
export default data