|
|
@@ -2,6 +2,7 @@ import Joi from 'joi'
|
|
2
|
2
|
|
|
3
|
3
|
import { Connector } from './db'
|
|
4
|
4
|
import { SurveyFactory } from './survey'
|
|
|
5
|
+import { NotificationFactory } from './notification'
|
|
5
|
6
|
import { possible } from './lang'
|
|
6
|
7
|
import { pidMixin, cardMixin } from './mixins'
|
|
7
|
8
|
|
|
|
@@ -21,6 +22,7 @@ const makeKebob = input => {
|
|
21
|
22
|
}
|
|
22
|
23
|
|
|
23
|
24
|
const surveyFactory = new SurveyFactory(possible['usa'])
|
|
|
25
|
+const notificationFactory = new NotificationFactory
|
|
24
|
26
|
|
|
25
|
27
|
const mixins = { pidMixin, cardMixin }
|
|
26
|
28
|
|
|
|
@@ -74,34 +76,35 @@ const randomMedia = () => {
|
|
74
|
76
|
|
|
75
|
77
|
const randomSurveyResponses = count => {
|
|
76
|
78
|
const surveyResponses = [
|
|
77
|
|
- { id: null ,"idOrPrompt": "email", "val": `${randomEmail()}` },
|
|
78
|
|
- { id: null ,"idOrPrompt": "name", "val": `john test-${count}` },
|
|
79
|
|
- { id: 99 ,"idOrPrompt": 15, "val": randomValFrom(possible.usa.pronouns) },
|
|
80
|
|
- { id: null ,"idOrPrompt": "seeking", "val": Math.random() > 0.2 ? possible.usa.seeking[0] : possible.usa.seeking[1] },
|
|
81
|
|
- { id: 99 ,"idOrPrompt": 13, "val": randomValFrom(possible.usa.urgency) },
|
|
82
|
|
- { id: null ,"idOrPrompt": "experience", "val": randomValFrom(possible.usa.experience) },
|
|
83
|
|
- { id: 99 ,"idOrPrompt": 14, "val": "swe" },
|
|
84
|
|
- { id: 99 ,"idOrPrompt": 10, "val": randomValFrom(possible.usa.duration) },
|
|
85
|
|
- { id: 99 ,"idOrPrompt": 9, "val": randomValFrom(possible.usa.language) },
|
|
86
|
|
- { id: 99 ,"idOrPrompt": 11, "val": randomValFrom(possible.usa.presence) },
|
|
87
|
|
- { id: 99 ,"idOrPrompt": 7, "val": `${randomValFrom(possibleZipcodes)}` },
|
|
88
|
|
- { id: 99 ,"idOrPrompt": 16, "val": `${randomNumber(55)}` },
|
|
89
|
|
- { id: 99 ,"idOrPrompt": 12, "val": "this is a test of the survey signup" },
|
|
90
|
|
- { id: 99 ,"idOrPrompt": 8, "val": randomMedia() },
|
|
91
|
|
- { id: 99 ,"idOrPrompt": 1, "val": `${randomNumber(3) - randomNumber(3)}` },
|
|
92
|
|
- { id: 99 ,"idOrPrompt": 2, "val": `${randomNumber(3) - randomNumber(3)}` },
|
|
93
|
|
- { id: 99 ,"idOrPrompt": 3, "val": `${randomNumber(3) - randomNumber(3)}` },
|
|
94
|
|
- { id: 99 ,"idOrPrompt": 4, "val": `${randomNumber(3) - randomNumber(3)}` },
|
|
95
|
|
- { id: 99 ,"idOrPrompt": 5, "val": `${randomNumber(3) - randomNumber(3)}` },
|
|
96
|
|
- { id: 99 ,"idOrPrompt": 6, "val": `${randomNumber(3) - randomNumber(3)}` }
|
|
|
79
|
+ { id: null, "idOrPrompt": "email", "val": `${randomEmail()}` },
|
|
|
80
|
+ { id: null, "idOrPrompt": "name", "val": `john test-${count}` },
|
|
|
81
|
+ { id: 99, "idOrPrompt": 15, "val": randomValFrom(possible.usa.pronouns) },
|
|
|
82
|
+ { id: null, "idOrPrompt": "seeking", "val": Math.random() > 0.2 ? possible.usa.seeking[0] : possible.usa.seeking[1] },
|
|
|
83
|
+ { id: 99, "idOrPrompt": 13, "val": randomValFrom(possible.usa.urgency) },
|
|
|
84
|
+ { id: null, "idOrPrompt": "experience", "val": randomValFrom(possible.usa.experience) },
|
|
|
85
|
+ { id: 99, "idOrPrompt": 14, "val": "swe" },
|
|
|
86
|
+ { id: 99, "idOrPrompt": 10, "val": randomValFrom(possible.usa.duration) },
|
|
|
87
|
+ { id: 99, "idOrPrompt": 9, "val": randomValFrom(possible.usa.language) },
|
|
|
88
|
+ { id: 99, "idOrPrompt": 11, "val": randomValFrom(possible.usa.presence) },
|
|
|
89
|
+ { id: 99, "idOrPrompt": 7, "val": `${randomValFrom(possibleZipcodes)}` },
|
|
|
90
|
+ { id: 99, "idOrPrompt": 16, "val": `${randomNumber(55)}` },
|
|
|
91
|
+ { id: 99, "idOrPrompt": 12, "val": "this is a test of the survey signup" },
|
|
|
92
|
+ { id: 99, "idOrPrompt": 8, "val": randomMedia() },
|
|
|
93
|
+ { id: 99, "idOrPrompt": 1, "val": `${randomNumber(3) - randomNumber(3)}` },
|
|
|
94
|
+ { id: 99, "idOrPrompt": 2, "val": `${randomNumber(3) - randomNumber(3)}` },
|
|
|
95
|
+ { id: 99, "idOrPrompt": 3, "val": `${randomNumber(3) - randomNumber(3)}` },
|
|
|
96
|
+ { id: 99, "idOrPrompt": 4, "val": `${randomNumber(3) - randomNumber(3)}` },
|
|
|
97
|
+ { id: 99, "idOrPrompt": 5, "val": `${randomNumber(3) - randomNumber(3)}` },
|
|
|
98
|
+ { id: 99, "idOrPrompt": 6, "val": `${randomNumber(3) - randomNumber(3)}` }
|
|
97
|
99
|
]
|
|
98
|
100
|
return surveyResponses
|
|
99
|
101
|
}
|
|
100
|
102
|
|
|
101
|
|
-export {
|
|
|
103
|
+export {
|
|
102
|
104
|
api,
|
|
103
|
105
|
validatorMapping,
|
|
104
|
106
|
surveyFactory,
|
|
|
107
|
+ notificationFactory,
|
|
105
|
108
|
makeKebob,
|
|
106
|
109
|
mixins,
|
|
107
|
110
|
randomSurveyResponses,
|