-
Notifications
You must be signed in to change notification settings - Fork 8
/
schema.js
120 lines (78 loc) · 2.86 KB
/
schema.js
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
'use strict';
import Mungo from 'mungo';
import Race from '../race';
import MaritalStatus from '../marital-status';
import Employment from '../employment';
import Education from '../education';
import PoliticalParty from '../political-party';
import PoliticalTendency from '../political-tendency';
import Country from '../country';
import State from '../state';
class Schema extends Mungo.Model {
static gender = ['M', 'F', 'O'];
static get schema () {
return {
"email" : {
"type" : String
},
"password" : {
"type" : String,
"private" : true
},
"image" : String,
"preferences" : [{
"name" : String,
"value" : Mungo.Mixed
}],
"twitter" : String,
"facebook" : String,
"first_name" : String,
"middle_name" : String,
"last_name" : String,
"gps" : {
type : [Number],
index : '2d'
},
"gps validated" : Date,
"activation_key" : String,
"activation_token" : String,
"race" : {
"type" : [Race],
"distinct" : true
},
"gender" : {
"type" : String,
"validate" : value => this.gender.indexOf(value) > -1
},
"married" : MaritalStatus,
"employment" : Employment,
"education" : Education,
"citizenship" : Country,
"dualcitizenship" : Country,
"dob" : Date,
"registered_voter" : Boolean,
"party" : PoliticalParty,
"tendency" : PoliticalTendency,
"city" : String,
"state" : State,
"zip" : String,
"zip4" : String,
"neighborhood" : String,
"member_type" : String,
"gun_type" : String,
"starting_bloc_type": String,
"year_of_birth" : Number,
"street_address" : Mungo.Mixed,
"gender_identity" : Mungo.Mixed,
"starting_bloc_race": Mungo.Mixed,
"turks": [{
"hitId": String,
"assignmentId": String,
"turkSubmitTo": String,
"comment": String
}],
"workerId": String,
};
}
}
export default Schema;