vets_json_schema 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.babelrc +3 -0
- data/.gitattributes +1 -0
- data/.gitignore +1 -0
- data/.nvmrc +1 -0
- data/.travis.yml +12 -0
- data/README.md +9 -0
- data/dist/edu-benefits-schema.json +0 -0
- data/lib/vets_json_schema.rb +5 -0
- data/package.json +28 -0
- data/src/common/constants.js +1597 -0
- data/src/edu-benefits/schema.js +462 -0
- data/src/generate-schemas.js +5 -0
- data/src/start.js +10 -0
- data/src/watch.js +16 -0
- data/test/edu-benefits/schema.spec.js +330 -0
- data/test/mocha.opts +1 -0
- data/vets_json_schema.gemspec +13 -0
- metadata +59 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
import constants from '../common/constants';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
|
|
4
|
+
const countries = constants.countries.map(object => object.value);
|
|
5
|
+
const countriesWithAnyState = Object.keys(constants.states).filter(x => _.includes(countries, x));
|
|
6
|
+
const benefits = ['chapter33', 'chapter30', 'chapter1606', 'chapter32'];
|
|
7
|
+
const countryStateProperites = _.map(constants.states, (value, key) => ({
|
|
8
|
+
properties: {
|
|
9
|
+
country: {
|
|
10
|
+
'enum': [key]
|
|
11
|
+
},
|
|
12
|
+
state: {
|
|
13
|
+
'enum': value.map(x => x.value)
|
|
14
|
+
},
|
|
15
|
+
postalCode: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
maxLength: 10
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
countryStateProperites.push(
|
|
22
|
+
{
|
|
23
|
+
properties: {
|
|
24
|
+
country: {
|
|
25
|
+
not: {
|
|
26
|
+
'enum': countriesWithAnyState
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
state: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
maxLength: 51
|
|
32
|
+
},
|
|
33
|
+
postalCode: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
maxLength: 51
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
module.exports = {
|
|
41
|
+
$schema: 'http://json-schema.org/draft-04/schema#',
|
|
42
|
+
title: 'Education Benefits Claim',
|
|
43
|
+
type: 'object',
|
|
44
|
+
definitions: {
|
|
45
|
+
address: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
oneOf: countryStateProperites,
|
|
48
|
+
properties: {
|
|
49
|
+
street: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
minLength: 1,
|
|
52
|
+
maxLength: 50
|
|
53
|
+
},
|
|
54
|
+
street2: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
minLength: 1,
|
|
57
|
+
maxLength: 50
|
|
58
|
+
},
|
|
59
|
+
city: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
minLength: 1,
|
|
62
|
+
maxLength: 51
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
required: [
|
|
66
|
+
'street',
|
|
67
|
+
'city',
|
|
68
|
+
'country'
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
year: {
|
|
72
|
+
type: 'integer',
|
|
73
|
+
minimum: 1900
|
|
74
|
+
},
|
|
75
|
+
date: {
|
|
76
|
+
format: 'date',
|
|
77
|
+
type: 'string'
|
|
78
|
+
},
|
|
79
|
+
dateRange: {
|
|
80
|
+
type: 'object',
|
|
81
|
+
properties: {
|
|
82
|
+
from: {
|
|
83
|
+
$ref: '#/definitions/date'
|
|
84
|
+
},
|
|
85
|
+
to: {
|
|
86
|
+
oneOf: [
|
|
87
|
+
{
|
|
88
|
+
$ref: '#/definitions/date'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: 'string',
|
|
92
|
+
enum: ['present']
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
required: ['from', 'to']
|
|
98
|
+
},
|
|
99
|
+
fullName: {
|
|
100
|
+
type: 'object',
|
|
101
|
+
properties: {
|
|
102
|
+
salutation: {
|
|
103
|
+
type: 'string'
|
|
104
|
+
},
|
|
105
|
+
first: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
minLength: 1,
|
|
108
|
+
maxLength: 30
|
|
109
|
+
},
|
|
110
|
+
middle: {
|
|
111
|
+
type: 'string'
|
|
112
|
+
},
|
|
113
|
+
last: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
minLength: 1,
|
|
116
|
+
maxLength: 30
|
|
117
|
+
},
|
|
118
|
+
suffix: {
|
|
119
|
+
'enum': constants.suffixes
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
required: [
|
|
123
|
+
'first',
|
|
124
|
+
'last'
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
phone: {
|
|
128
|
+
type: 'string',
|
|
129
|
+
pattern: '^[0-9]{10}$'
|
|
130
|
+
},
|
|
131
|
+
ssn: {
|
|
132
|
+
type: 'string',
|
|
133
|
+
pattern: '^[0-9]{9}$'
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
additionalProperties: false,
|
|
137
|
+
properties: {
|
|
138
|
+
chapter33: {
|
|
139
|
+
type: 'boolean'
|
|
140
|
+
},
|
|
141
|
+
chapter30: {
|
|
142
|
+
type: 'boolean'
|
|
143
|
+
},
|
|
144
|
+
chapter1606: {
|
|
145
|
+
type: 'boolean'
|
|
146
|
+
},
|
|
147
|
+
chapter32: {
|
|
148
|
+
type: 'boolean'
|
|
149
|
+
},
|
|
150
|
+
benefitsRelinquished: {
|
|
151
|
+
type: 'string',
|
|
152
|
+
'enum': ['chapter1607', 'unknown', ..._.without(benefits, 'chapter33', 'chapter32')]
|
|
153
|
+
},
|
|
154
|
+
veteranFullName: {
|
|
155
|
+
$ref: '#/definitions/fullName'
|
|
156
|
+
},
|
|
157
|
+
gender: {
|
|
158
|
+
type: 'string',
|
|
159
|
+
'enum': ['M', 'F']
|
|
160
|
+
},
|
|
161
|
+
veteranDateOfBirth: {
|
|
162
|
+
$ref: '#/definitions/date'
|
|
163
|
+
},
|
|
164
|
+
veteranSocialSecurityNumber: {
|
|
165
|
+
$ref: '#/definitions/ssn'
|
|
166
|
+
},
|
|
167
|
+
veteranAddress: {
|
|
168
|
+
$ref: '#/definitions/address'
|
|
169
|
+
},
|
|
170
|
+
email: {
|
|
171
|
+
type: 'string',
|
|
172
|
+
format: 'email'
|
|
173
|
+
},
|
|
174
|
+
homePhone: {
|
|
175
|
+
$ref: '#/definitions/phone'
|
|
176
|
+
},
|
|
177
|
+
mobilePhone: {
|
|
178
|
+
$ref: '#/definitions/phone'
|
|
179
|
+
},
|
|
180
|
+
preferredContactMethod: {
|
|
181
|
+
type: 'string',
|
|
182
|
+
enum: ['mail', 'email', 'phone']
|
|
183
|
+
},
|
|
184
|
+
secondaryContact: {
|
|
185
|
+
type: 'object',
|
|
186
|
+
properties: {
|
|
187
|
+
fullName: {
|
|
188
|
+
type: 'string'
|
|
189
|
+
},
|
|
190
|
+
sameAddress: {
|
|
191
|
+
type: 'boolean'
|
|
192
|
+
},
|
|
193
|
+
address: {
|
|
194
|
+
$ref: '#/definitions/address'
|
|
195
|
+
},
|
|
196
|
+
phone: {
|
|
197
|
+
$ref: '#/definitions/phone'
|
|
198
|
+
},
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
bankAccount: {
|
|
202
|
+
type: 'object',
|
|
203
|
+
properties: {
|
|
204
|
+
accountType: {
|
|
205
|
+
type: 'string',
|
|
206
|
+
'enum': ['checking', 'savings']
|
|
207
|
+
},
|
|
208
|
+
routingNumber: {
|
|
209
|
+
type: 'string',
|
|
210
|
+
pattern: '^\\d{9}$'
|
|
211
|
+
},
|
|
212
|
+
accountNumber: {
|
|
213
|
+
type: 'string'
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
previouslyFiledClaimWithVa: {
|
|
218
|
+
type: 'boolean'
|
|
219
|
+
},
|
|
220
|
+
previousVaClaims: {
|
|
221
|
+
type: 'array',
|
|
222
|
+
items: {
|
|
223
|
+
type: 'object',
|
|
224
|
+
properties: {
|
|
225
|
+
claimType: {
|
|
226
|
+
type: 'string',
|
|
227
|
+
'enum': [
|
|
228
|
+
'chapter30',
|
|
229
|
+
'chapter32',
|
|
230
|
+
'chapter33',
|
|
231
|
+
'chapter34',
|
|
232
|
+
'chapter35',
|
|
233
|
+
'chapter1606',
|
|
234
|
+
'chapter1607',
|
|
235
|
+
'nationalService',
|
|
236
|
+
'transferredBenefits',
|
|
237
|
+
'vocationalRehab',
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
previouslyAppliedWithSomeoneElsesService: {
|
|
241
|
+
type: 'boolean'
|
|
242
|
+
},
|
|
243
|
+
fileNumber: {
|
|
244
|
+
type: 'string'
|
|
245
|
+
},
|
|
246
|
+
sponsorVeteran: {
|
|
247
|
+
type: 'object',
|
|
248
|
+
properties: {
|
|
249
|
+
fullName: {
|
|
250
|
+
$ref: '#/definitions/fullName'
|
|
251
|
+
},
|
|
252
|
+
fileNumber: {
|
|
253
|
+
type: 'string'
|
|
254
|
+
},
|
|
255
|
+
payeeNumber: {
|
|
256
|
+
type: 'string'
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
required: ['claimType']
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
school: {
|
|
265
|
+
type: 'object',
|
|
266
|
+
properties: {
|
|
267
|
+
name: {
|
|
268
|
+
type: 'string'
|
|
269
|
+
},
|
|
270
|
+
address: {
|
|
271
|
+
$ref: '#/definitions/address'
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
educationStartDate: {
|
|
276
|
+
$ref: '#/definitions/date'
|
|
277
|
+
},
|
|
278
|
+
educationObjective: {
|
|
279
|
+
type: 'string'
|
|
280
|
+
},
|
|
281
|
+
educationType: {
|
|
282
|
+
type: 'string',
|
|
283
|
+
enum: ['college', 'correspondence', 'apprenticeship', 'flightTraining', 'testReimbursement', 'licensingReimbursement', 'tuitionTopUp']
|
|
284
|
+
},
|
|
285
|
+
currentlyActiveDuty: {
|
|
286
|
+
type: 'object',
|
|
287
|
+
properties: {
|
|
288
|
+
yes: {
|
|
289
|
+
type: 'boolean'
|
|
290
|
+
},
|
|
291
|
+
onTerminalLeave: {
|
|
292
|
+
type: 'boolean'
|
|
293
|
+
},
|
|
294
|
+
nonVaAssistance: {
|
|
295
|
+
type: 'boolean'
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
highSchoolOrGedCompletionDate: {
|
|
300
|
+
$ref: '#/definitions/date'
|
|
301
|
+
},
|
|
302
|
+
faaFlightCertificatesInformation: {
|
|
303
|
+
type: 'string'
|
|
304
|
+
},
|
|
305
|
+
serviceAcademyGraduationYear: {
|
|
306
|
+
$ref: '#/definitions/year'
|
|
307
|
+
},
|
|
308
|
+
seniorRotc: {
|
|
309
|
+
type: 'object',
|
|
310
|
+
properties: {
|
|
311
|
+
commissionYear: {
|
|
312
|
+
$ref: '#/definitions/year'
|
|
313
|
+
},
|
|
314
|
+
rotcScholarshipAmounts: {
|
|
315
|
+
type: 'array',
|
|
316
|
+
items: {
|
|
317
|
+
type: 'object',
|
|
318
|
+
properties: {
|
|
319
|
+
year: {
|
|
320
|
+
type: 'integer'
|
|
321
|
+
},
|
|
322
|
+
amount: {
|
|
323
|
+
type: 'number'
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
required: ['year', 'amount']
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
required: ['commissionYear', 'rotcScholarshipAmounts']
|
|
331
|
+
},
|
|
332
|
+
seniorRotcScholarshipProgram: {
|
|
333
|
+
type: 'boolean'
|
|
334
|
+
},
|
|
335
|
+
civilianBenefitsAssistance: {
|
|
336
|
+
type: 'boolean'
|
|
337
|
+
},
|
|
338
|
+
additionalContributions: {
|
|
339
|
+
type: 'boolean'
|
|
340
|
+
},
|
|
341
|
+
activeDutyKicker: {
|
|
342
|
+
type: 'boolean'
|
|
343
|
+
},
|
|
344
|
+
reserveKicker: {
|
|
345
|
+
type: 'boolean'
|
|
346
|
+
},
|
|
347
|
+
activeDutyRepayingPeriod: {
|
|
348
|
+
$ref: '#/definitions/dateRange'
|
|
349
|
+
},
|
|
350
|
+
serviceBefore1977: {
|
|
351
|
+
type: 'object',
|
|
352
|
+
properties: {
|
|
353
|
+
married: {
|
|
354
|
+
type: 'boolean'
|
|
355
|
+
},
|
|
356
|
+
haveDependents: {
|
|
357
|
+
type: 'boolean'
|
|
358
|
+
},
|
|
359
|
+
parentDependent: {
|
|
360
|
+
type: 'boolean'
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
required: ['married', 'haveDependents', 'parentDependent']
|
|
364
|
+
},
|
|
365
|
+
remarks: {
|
|
366
|
+
type: 'string'
|
|
367
|
+
},
|
|
368
|
+
toursOfDuty: {
|
|
369
|
+
type: 'array',
|
|
370
|
+
items: {
|
|
371
|
+
type: 'object',
|
|
372
|
+
properties: {
|
|
373
|
+
dateRange: {
|
|
374
|
+
$ref: '#/definitions/dateRange'
|
|
375
|
+
},
|
|
376
|
+
serviceBranch: {
|
|
377
|
+
type: 'string'
|
|
378
|
+
// TODO enum for this field?
|
|
379
|
+
},
|
|
380
|
+
serviceStatus: {
|
|
381
|
+
type: 'string'
|
|
382
|
+
},
|
|
383
|
+
benefitsToApplyTo: {
|
|
384
|
+
type: 'string',
|
|
385
|
+
enum: [
|
|
386
|
+
'chapter30',
|
|
387
|
+
'chapter1606',
|
|
388
|
+
'chapter32'
|
|
389
|
+
]
|
|
390
|
+
},
|
|
391
|
+
involuntarilyCalledToDuty: {
|
|
392
|
+
type: 'string',
|
|
393
|
+
'enum': ['yes', 'no', 'n/a']
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
required: ['dateRange', 'serviceBranch']
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
postHighSchoolTrainings: {
|
|
400
|
+
type: 'array',
|
|
401
|
+
items: {
|
|
402
|
+
type: 'object',
|
|
403
|
+
properties: {
|
|
404
|
+
name: {
|
|
405
|
+
type: 'string'
|
|
406
|
+
},
|
|
407
|
+
city: {
|
|
408
|
+
type: 'string'
|
|
409
|
+
},
|
|
410
|
+
state: {
|
|
411
|
+
type: 'string',
|
|
412
|
+
enum: _.map(constants.states.USA, (stateData) => { return stateData.value })
|
|
413
|
+
},
|
|
414
|
+
dateRange: {
|
|
415
|
+
$ref: '#/definitions/dateRange'
|
|
416
|
+
},
|
|
417
|
+
hours: {
|
|
418
|
+
type: 'integer'
|
|
419
|
+
},
|
|
420
|
+
hoursType: {
|
|
421
|
+
type: 'string',
|
|
422
|
+
'enum': ['semester', 'quarter', 'clock']
|
|
423
|
+
},
|
|
424
|
+
degreeReceived: {
|
|
425
|
+
type: 'string'
|
|
426
|
+
},
|
|
427
|
+
major: {
|
|
428
|
+
type: 'string'
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
required: ['name', 'dateRange']
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
nonMilitaryJobs: {
|
|
435
|
+
type: 'array',
|
|
436
|
+
items: {
|
|
437
|
+
type: 'object',
|
|
438
|
+
properties: {
|
|
439
|
+
name: {
|
|
440
|
+
type: 'string'
|
|
441
|
+
},
|
|
442
|
+
months: {
|
|
443
|
+
type: 'integer'
|
|
444
|
+
},
|
|
445
|
+
licenseOrRating: {
|
|
446
|
+
type: 'string'
|
|
447
|
+
},
|
|
448
|
+
postMilitaryJob: {
|
|
449
|
+
type: 'boolean'
|
|
450
|
+
},
|
|
451
|
+
},
|
|
452
|
+
required: ['name']
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
applyingUsingOwnBenefits: {
|
|
456
|
+
type: "boolean"
|
|
457
|
+
},
|
|
458
|
+
benefitsRelinquishedDate: {
|
|
459
|
+
'$ref': '#/definitions/date'
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
};
|