diff --git a/dist/22-10215-schema.json b/dist/22-10215-schema.json index 1f999b69..0766be22 100644 --- a/dist/22-10215-schema.json +++ b/dist/22-10215-schema.json @@ -10,8 +10,11 @@ } }, "required": [ + "certifyingOfficial", "institutionDetails", - "programs" + "programs", + "statementOfTruthSignature", + "dateSigned" ], "properties": { "institutionDetails": { @@ -37,6 +40,25 @@ } } }, + "certifyingOfficial": { + "type": "object", + "required": [ + "first", + "last", + "title" + ], + "properties": { + "first": { + "type": "string" + }, + "last": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, "programs": { "type": "array", "items": { @@ -75,6 +97,12 @@ } } } + }, + "statementOfTruthSignature": { + "type": "string" + }, + "dateSigned": { + "$ref": "#/definitions/date" } } } diff --git a/package.json b/package.json index 6428a9e6..64b31e01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vets-json-schema", - "version": "24.8.0", + "version": "24.8.1", "license": "CC0-1.0", "repository": { "type": "git", diff --git a/src/schemas/22-10215/schema.js b/src/schemas/22-10215/schema.js index 4a936011..d9f4a682 100644 --- a/src/schemas/22-10215/schema.js +++ b/src/schemas/22-10215/schema.js @@ -9,7 +9,7 @@ const schema = { type: 'object', additionalProperties: false, definitions: pickedDefinitions, - required: ['institutionDetails', 'programs'], + required: ['certifyingOfficial', 'institutionDetails', 'programs', 'statementOfTruthSignature', 'dateSigned'], properties: { institutionDetails: { type: 'object', @@ -29,6 +29,21 @@ const schema = { }, }, }, + certifyingOfficial: { + type: 'object', + required: ['first', 'last', 'title'], + properties: { + first: { + type: 'string', + }, + last: { + type: 'string', + }, + title: { + type: 'string', + }, + }, + }, programs: { type: 'array', items: { @@ -64,6 +79,12 @@ const schema = { }, }, }, + statementOfTruthSignature: { + type: "string" + }, + dateSigned: { + $ref: '#/definitions/date', + }, }, }; diff --git a/test/schemas/22-10215/schema.spec.js b/test/schemas/22-10215/schema.spec.js index 678e0260..c660a150 100644 --- a/test/schemas/22-10215/schema.spec.js +++ b/test/schemas/22-10215/schema.spec.js @@ -8,6 +8,27 @@ const schemaClone = cloneDeep(schema); const schemaTestHelper = new SchemaTestHelper(omit(schemaClone, 'required')); const testData = { + institutionOfficial: { + valid: [ + { + first: 'John', + last: 'Doe', + title: 'President', + }, + ], + invalid: [ + { + first: 'John', + last: 'Doe', + title: null, + }, + { + first: 'John', + last: '', + title: null, + }, + ], + }, institutionDetails: { valid: [ { @@ -119,8 +140,11 @@ const testData = { describe('22-10215 Schema', () => { it('should have required fields', () => { expect(schema.required).to.deep.equal([ + 'certifyingOfficial', 'institutionDetails', 'programs', + 'statementOfTruthSignature', + 'dateSigned', ]); expect(schema.properties.institutionDetails.required).to.deep.equal([ 'institutionName', @@ -135,6 +159,7 @@ describe('22-10215 Schema', () => { ]); }); + schemaTestHelper.testValidAndInvalid('certifyingOfficial', testData.institutionOfficial); schemaTestHelper.testValidAndInvalid('institutionDetails', testData.institutionDetails); schemaTestHelper.testValidAndInvalid('programs', testData.programs); });