Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test schema versioning #942

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions dist/schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,21 @@ var schemas = {};
fs.readdirSync(__dirname).forEach((fileName) => {
if (fileName === 'schemas.js') return;

if (fileName === 'versions') return;

schemas[fileName.replace('.json', '').replace('-schema', '')] = require('./' + fileName);
});

var versions = {};
fs.readdirSync(`${__dirname}/versions`).forEach((version) => {
versions[version] = [];
fs.readdirSync(`${__dirname}/versions/${version}`).forEach((fileName) => {
if (fileName === 'schemas.js') return;

versions[version][fileName.replace('.json', '').replace('-schema', '')] = require('./' + fileName);
});
});

schemas.versions = versions;

module.exports = schemas;
1 change: 1 addition & 0 deletions dist/versions/24.3.3/0873-schema.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/versions/24.3.3/10-10CG-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"veteran":{"fullName":{"first":"Jane Doe","last":"Doe"},"ssnOrTin":"789787893","dateOfBirth":"1990-07-03","address":{"street":"111 2nd St S","city":"Seattle","state":"WA","postalCode":"33771","county":"Washington"},"primaryPhoneNumber":"8887775544","plannedClinic":"740","certifications":["information-is-correct-and-true","consent-to-caregivers-to-perform-care"]},"primaryCaregiver":{"fullName":{"first":"Joan","last":"Doe"},"dateOfBirth":"1978-07-03","address":{"street":"111 2nd St S","city":"Seattle","state":"WA","postalCode":"33771","county":"Washington"},"primaryPhoneNumber":"8887775544","vetRelationship":"Spouse","certifications":["information-is-correct-and-true","at-least-18-years-of-age","member-of-veterans-family","agree-to-perform-services--as-primary","understand-revocable-status--as-primary","have-understanding-of-non-employment-relationship"]},"secondaryCaregiverOne":{"fullName":{"first":"John Doe","middle":"A","last":"Doe"},"dateOfBirth":"1989-11-06","address":{"street":"111 2nd St S","city":"Seattle","state":"WA","postalCode":"33771-1234","county":"Washington"},"primaryPhoneNumber":"8887775544","vetRelationship":"Friend/Neighbor","certifications":["information-is-correct-and-true","at-least-18-years-of-age","not-member-of-veterans-family","currently-or-will-reside-with-veteran--as-secondary","agree-to-perform-services--as-secondary","understand-revocable-status--as-secondary","have-understanding-of-non-employment-relationship"]}}
1 change: 1 addition & 0 deletions dist/versions/24.3.3/10-10CG-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/draft-04/schema#","title":"Application for Comprehensive Assistance for Family Caregivers Program (10-10CG)","type":"object","additionalProperties":false,"required":["veteran"],"anyOf":[{"required":["primaryCaregiver"]},{"required":["secondaryCaregiverOne"]}],"definitions":{"fullName":{"type":"object","additionalProperties":false,"required":["first","last"],"properties":{"first":{"type":"string","minLength":1,"maxLength":30},"middle":{"type":"string","maxLength":30},"last":{"type":"string","minLength":1,"maxLength":30},"suffix":{"type":"string","enum":["Jr.","Sr.","II","III","IV"]}}},"ssn":{"type":"string","pattern":"^[0-9]{9}$"},"date":{"pattern":"^(\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$","type":"string"},"gender":{"type":"string","enum":["F","M"]},"phone":{"type":"string","minLength":10,"maxLength":40},"email":{"type":"string","maxLength":80,"format":"email"},"address":{"type":"object","additionalProperties":false,"required":["street","city","state","postalCode","county"],"properties":{"street":{"type":"string","minLength":1,"maxLength":50},"street2":{"type":"string","minLength":1,"maxLength":50},"city":{"type":"string","minLength":1,"maxLength":40},"state":{"type":"string","enum":["AL","AK","AS","AZ","AR","AA","AE","AP","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OH","OK","OR","PW","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY"]},"postalCode":{"type":"string","pattern":"^(\\d{5})(?:[-](\\d{4}))?$"},"county":{"type":"string","maxLength":60}}},"mailingAddress":{"type":"object","additionalProperties":false,"properties":{"street":{"type":"string","minLength":1,"maxLength":50},"street2":{"type":"string","minLength":1,"maxLength":50},"city":{"type":"string","minLength":1,"maxLength":40},"state":{"type":"string","enum":["AL","AK","AS","AZ","AR","AA","AE","AP","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OH","OK","OR","PW","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY"]},"postalCode":{"type":"string","pattern":"^(\\d{5})(?:[-](\\d{4}))?$"},"county":{"type":"string","maxLength":60}}},"vetRelationship":{"type":"string","enum":["Spouse","Father","Mother","Son","Daughter","Brother","Sister","Significant Other","Relative - Other","Friend/Neighbor","Grandchild"]},"uuid":{"type":"string","format":"uuid"},"signature":{"type":"string","minLength":1,"maxLength":150}},"properties":{"veteran":{"type":"object","additionalProperties":false,"required":["fullName","ssnOrTin","dateOfBirth","address","primaryPhoneNumber","plannedClinic"],"properties":{"fullName":{"$ref":"#/definitions/fullName"},"ssnOrTin":{"$ref":"#/definitions/ssn"},"dateOfBirth":{"$ref":"#/definitions/date"},"gender":{"$ref":"#/definitions/gender"},"address":{"$ref":"#/definitions/address"},"primaryPhoneNumber":{"$ref":"#/definitions/phone"},"alternativePhoneNumber":{"$ref":"#/definitions/phone"},"email":{"$ref":"#/definitions/email"},"plannedClinic":{"type":"string"},"signature":{"$ref":"#/definitions/signature"},"certifications":{"type":"array","uniqueItems":true,"minItems":2,"maxItems":2,"items":{"type":"string","enum":["information-is-correct-and-true","consent-to-caregivers-to-perform-care"]}}}},"primaryCaregiver":{"type":"object","additionalProperties":false,"required":["fullName","dateOfBirth","address","primaryPhoneNumber","vetRelationship"],"properties":{"fullName":{"$ref":"#/definitions/fullName"},"ssnOrTin":{"$ref":"#/definitions/ssn"},"dateOfBirth":{"$ref":"#/definitions/date"},"gender":{"$ref":"#/definitions/gender"},"address":{"$ref":"#/definitions/address"},"mailingAddress":{"$ref":"#/definitions/mailingAddress"},"primaryPhoneNumber":{"$ref":"#/definitions/phone"},"alternativePhoneNumber":{"$ref":"#/definitions/phone"},"email":{"$ref":"#/definitions/email"},"vetRelationship":{"$ref":"#/definitions/vetRelationship"},"signature":{"$ref":"#/definitions/signature"},"certifications":{"type":"array","uniqueItems":true,"minItems":6,"maxItems":7,"items":{"type":"string","enum":["information-is-correct-and-true","at-least-18-years-of-age","member-of-veterans-family","not-member-of-veterans-family","currently-or-will-reside-with-veteran--as-primary","agree-to-perform-services--as-primary","understand-revocable-status--as-primary","have-understanding-of-non-employment-relationship"]}}}},"secondaryCaregiverOne":{"type":"object","additionalProperties":false,"required":["fullName","dateOfBirth","address","primaryPhoneNumber","vetRelationship"],"properties":{"fullName":{"$ref":"#/definitions/fullName"},"ssnOrTin":{"$ref":"#/definitions/ssn"},"dateOfBirth":{"$ref":"#/definitions/date"},"gender":{"$ref":"#/definitions/gender"},"address":{"$ref":"#/definitions/address"},"mailingAddress":{"$ref":"#/definitions/mailingAddress"},"primaryPhoneNumber":{"$ref":"#/definitions/phone"},"alternativePhoneNumber":{"$ref":"#/definitions/phone"},"email":{"$ref":"#/definitions/email"},"vetRelationship":{"$ref":"#/definitions/vetRelationship"},"signature":{"$ref":"#/definitions/signature"},"certifications":{"type":"array","uniqueItems":true,"minItems":6,"maxItems":7,"items":{"type":"string","enum":["information-is-correct-and-true","at-least-18-years-of-age","member-of-veterans-family","not-member-of-veterans-family","currently-or-will-reside-with-veteran--as-secondary","agree-to-perform-services--as-secondary","understand-revocable-status--as-secondary","have-understanding-of-non-employment-relationship"]}}}},"secondaryCaregiverTwo":{"type":"object","additionalProperties":false,"required":["fullName","dateOfBirth","address","primaryPhoneNumber","vetRelationship"],"properties":{"fullName":{"$ref":"#/definitions/fullName"},"ssnOrTin":{"$ref":"#/definitions/ssn"},"dateOfBirth":{"$ref":"#/definitions/date"},"gender":{"$ref":"#/definitions/gender"},"address":{"$ref":"#/definitions/address"},"mailingAddress":{"$ref":"#/definitions/mailingAddress"},"primaryPhoneNumber":{"$ref":"#/definitions/phone"},"alternativePhoneNumber":{"$ref":"#/definitions/phone"},"email":{"$ref":"#/definitions/email"},"vetRelationship":{"$ref":"#/definitions/vetRelationship"},"signature":{"$ref":"#/definitions/signature"},"certifications":{"type":"array","uniqueItems":true,"minItems":6,"maxItems":7,"items":{"type":"string","enum":["information-is-correct-and-true","at-least-18-years-of-age","member-of-veterans-family","not-member-of-veterans-family","currently-or-will-reside-with-veteran--as-secondary","agree-to-perform-services--as-secondary","understand-revocable-status--as-secondary","have-understanding-of-non-employment-relationship"]}}}},"poaAttachmentId":{"$ref":"#/definitions/uuid"},"signAsRepresentative":{"type":"boolean"}}}
Loading
Loading