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

58745 Switch to optional fields for va-medical-records page #775

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 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
11 changes: 2 additions & 9 deletions dist/21-526EZ-ALLCLAIMS-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,6 @@
},
"vaTreatmentCenterAddress": {
"type": "object",
"required": [
"country"
],
"properties": {
"country": {
"$ref": "#/definitions/country"
Expand Down Expand Up @@ -987,14 +984,10 @@
},
"vaTreatmentFacilities": {
"type": "array",
"minItems": 1,
"minItems": 0,
"maxItems": 100,
"items": {
"type": "object",
"required": [
"treatmentCenterName",
"treatedDisabilityNames"
],
"properties": {
"treatmentCenterName": {
"type": "string",
Expand All @@ -1009,7 +1002,7 @@
},
"treatedDisabilityNames": {
"type": "array",
"minItems": 1,
"minItems": 0,
"maxItems": 100,
"items": {
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vets-json-schema",
"version": "20.27.1",
"version": "20.27.2",
"repository": {
"type": "git",
"url": "git+https://github.com/department-of-veterans-affairs/vets-json-schema.git"
Expand Down
6 changes: 2 additions & 4 deletions src/schemas/21-526EZ-allclaims/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const vaTreatmentCenterAddressDef = (addressSchema => {
const { type, properties } = addressSchema;
return {
type,
required: ['country'],
properties: _.pick(['country', 'city', 'state'], properties),
};
})(baseAddressDef);
Expand Down Expand Up @@ -455,11 +454,10 @@ const schema = {
},
vaTreatmentFacilities: {
type: 'array',
minItems: 1,
minItems: 0,
maxItems: 100,
items: {
type: 'object',
required: ['treatmentCenterName', 'treatedDisabilityNames'],
properties: {
treatmentCenterName: {
type: 'string',
Expand All @@ -474,7 +472,7 @@ const schema = {
},
treatedDisabilityNames: {
type: 'array',
minItems: 1,
minItems: 0,
maxItems: 100,
items: {
type: 'string',
Expand Down
26 changes: 17 additions & 9 deletions test/schemas/21-526EZ/schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,8 @@ const data = {
],
},
vaTreatmentCenterAddress: {
valid: [{ country: 'USA' }, { country: 'Spain', city: 'abc' }, { country: 'Spain', city: 'xyz', state: 'AL' }],
invalid: [
{},
{ country: 'XYZ' },
{ country: 'Spain', state: 'AB' },
{ state: 'AL' },
{ country: 'USA', city: 1234 },
],
valid: [{}, { country: 'USA' }, { country: 'Spain', city: 'abc' }, { country: 'Spain', city: 'xyz', state: 'AL' }],
invalid: [{ country: 'XYZ' }, { country: 'Spain', state: 'AB' }, { country: 'USA', city: 1234 }],
},
homelessOrAtRisk: {
valid: ['no', 'homeless', 'atRisk'],
Expand All @@ -335,8 +329,22 @@ const data = {
vaTreatmentCenterAddress: { country: 'USA' },
},
],
[][{}],
],
invalid: [
{
treatmentCenterName: makeString(100, 'abc123'),
treatedDisabilityNames: ['xyz'],
treatmentDateRange: fixtures.dateRange,
vaTreatmentCenterAddress: { country: 'nowhere' },
},
{
treatmentCenterName: makeString(100, 'abc123'),
treatedDisabilityNames: ['xyz'],
treatmentDateRange: fixtures.dateRange,
vaTreatmentCenterAddress: { state: 'nope' },
},
],
invalid: [[], [{}], [{ treatmentCenterName: 1234 }], [{ treatmentCenterName: 'foo', treatedDisabilityNames: [] }]],
},
bankAccountType: {
valid: ['Checking', 'Savings'],
Expand Down