diff --git a/dist/21P-527EZ-KITCHEN_SINK-schema.json b/dist/21P-527EZ-KITCHEN_SINK-schema.json index 449602fd..a232042f 100644 --- a/dist/21P-527EZ-KITCHEN_SINK-schema.json +++ b/dist/21P-527EZ-KITCHEN_SINK-schema.json @@ -1200,6 +1200,9 @@ "statementOfTruthSignature": { "type": "string" }, + "signatureDate": { + "type": "string" + }, "veteranFullName": { "$ref": "#/definitions/benefitsIntakeFullName" }, diff --git a/dist/21P-527EZ-OVERFLOW-schema.json b/dist/21P-527EZ-OVERFLOW-schema.json index 449602fd..a232042f 100644 --- a/dist/21P-527EZ-OVERFLOW-schema.json +++ b/dist/21P-527EZ-OVERFLOW-schema.json @@ -1200,6 +1200,9 @@ "statementOfTruthSignature": { "type": "string" }, + "signatureDate": { + "type": "string" + }, "veteranFullName": { "$ref": "#/definitions/benefitsIntakeFullName" }, diff --git a/dist/21P-527EZ-SIMPLE-schema.json b/dist/21P-527EZ-SIMPLE-schema.json index 449602fd..a232042f 100644 --- a/dist/21P-527EZ-SIMPLE-schema.json +++ b/dist/21P-527EZ-SIMPLE-schema.json @@ -1200,6 +1200,9 @@ "statementOfTruthSignature": { "type": "string" }, + "signatureDate": { + "type": "string" + }, "veteranFullName": { "$ref": "#/definitions/benefitsIntakeFullName" }, diff --git a/dist/21P-527EZ-schema.json b/dist/21P-527EZ-schema.json index 449602fd..a232042f 100644 --- a/dist/21P-527EZ-schema.json +++ b/dist/21P-527EZ-schema.json @@ -1200,6 +1200,9 @@ "statementOfTruthSignature": { "type": "string" }, + "signatureDate": { + "type": "string" + }, "veteranFullName": { "$ref": "#/definitions/benefitsIntakeFullName" }, diff --git a/dist/22-10216-schema.json b/dist/22-10216-schema.json new file mode 100644 index 00000000..15bd7a3a --- /dev/null +++ b/dist/22-10216-schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "22-10216 5% EXEMPTION REQUEST FROM 85/15 REPORTING REQUIREMENT GENERAL INFORMATION (22-10216)", + "type": "object", + "additionalProperties": false, + "definitions": { + "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" + } + }, + "properties": { + "institutionDetails": { + "type": "object", + "required": [ + "institutionName", + "facilityCode", + "termStartDate" + ], + "properties": { + "institutionName": { + "type": "string" + }, + "facilityCode": { + "type": "string" + }, + "termStartDate": { + "$ref": "#/definitions/date" + } + } + }, + "studentRatioCalcChapter": { + "type": "object", + "required": [ + "beneficiaryStudent", + "numOfStudent", + "dateOfCalculation" + ], + "properties": { + "beneficiaryStudent": { + "type": "integer" + }, + "numOfStudent": { + "type": "integer" + }, + "VaBeneficiaryStudentsPercentage": { + "type": "number" + }, + "dateOfCalculation": { + "$ref": "#/definitions/date" + } + } + } + } +} diff --git a/dist/DISPUTE-DEBT-schema.json b/dist/DISPUTE-DEBT-schema.json new file mode 100644 index 00000000..377f76b0 --- /dev/null +++ b/dist/DISPUTE-DEBT-schema.json @@ -0,0 +1,543 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "DISPUTE DEBT", + "type": "object", + "properties": { + "contactInformation": { + "type": "object", + "properties": { + "email": { + "type": "string", + "maxLength": 256, + "format": "email" + }, + "address": { + "type": "object", + "properties": { + "isMilitary": { + "type": "boolean" + }, + "view:militaryBaseDescription": { + "type": "object", + "properties": {} + }, + "country": { + "type": "string", + "enum": [ + "USA", + "AFG", + "ALB", + "DZA", + "AND", + "AGO", + "AIA", + "ATA", + "ATG", + "ARG", + "ARM", + "ABW", + "AUS", + "AUT", + "AZE", + "BHS", + "BHR", + "BGD", + "BRB", + "BLR", + "BEL", + "BLZ", + "BEN", + "BMU", + "BTN", + "BOL", + "BIH", + "BWA", + "BVT", + "BRA", + "IOT", + "BRN", + "BGR", + "BFA", + "BDI", + "KHM", + "CMR", + "CAN", + "CPV", + "CYM", + "CAF", + "TCD", + "CHL", + "CHN", + "CXR", + "CCK", + "COL", + "COM", + "COG", + "COD", + "COK", + "CRI", + "CIV", + "HRV", + "CUB", + "CYP", + "CZE", + "DNK", + "DJI", + "DMA", + "DOM", + "ECU", + "EGY", + "SLV", + "GNQ", + "ERI", + "EST", + "ETH", + "FLK", + "FRO", + "FJI", + "FIN", + "FRA", + "GUF", + "PYF", + "ATF", + "GAB", + "GMB", + "GEO", + "DEU", + "GHA", + "GIB", + "GRC", + "GRL", + "GRD", + "GLP", + "GTM", + "GIN", + "GNB", + "GUY", + "HTI", + "HMD", + "HND", + "HKG", + "HUN", + "ISL", + "IND", + "IDN", + "IRN", + "IRQ", + "IRL", + "ISR", + "ITA", + "JAM", + "JPN", + "JOR", + "KAZ", + "KEN", + "KIR", + "PRK", + "KOR", + "KWT", + "KGZ", + "LAO", + "LVA", + "LBN", + "LSO", + "LBR", + "LBY", + "LIE", + "LTU", + "LUX", + "MAC", + "MKD", + "MDG", + "MWI", + "MYS", + "MDV", + "MLI", + "MLT", + "MTQ", + "MRT", + "MUS", + "MYT", + "MEX", + "FSM", + "MDA", + "MCO", + "MNG", + "MSR", + "MAR", + "MOZ", + "MMR", + "NAM", + "NRU", + "NPL", + "ANT", + "NLD", + "NCL", + "NZL", + "NIC", + "NER", + "NGA", + "NIU", + "NFK", + "NOR", + "OMN", + "PAK", + "PAN", + "PNG", + "PRY", + "PER", + "PHL", + "PCN", + "POL", + "PRT", + "QAT", + "REU", + "ROU", + "RUS", + "RWA", + "SHN", + "KNA", + "LCA", + "SPM", + "VCT", + "SMR", + "STP", + "SAU", + "SEN", + "SCG", + "SYC", + "SLE", + "SGP", + "SVK", + "SVN", + "SLB", + "SOM", + "ZAF", + "SGS", + "ESP", + "LKA", + "SDN", + "SUR", + "SWZ", + "SWE", + "CHE", + "SYR", + "TWN", + "TJK", + "TZA", + "THA", + "TLS", + "TGO", + "TKL", + "TON", + "TTO", + "TUN", + "TUR", + "TKM", + "TCA", + "TUV", + "UGA", + "UKR", + "ARE", + "GBR", + "URY", + "UZB", + "VUT", + "VAT", + "VEN", + "VNM", + "VGB", + "WLF", + "ESH", + "YEM", + "ZMB", + "ZWE" + ], + "enumNames": [ + "United States", + "Afghanistan", + "Albania", + "Algeria", + "Andorra", + "Angola", + "Anguilla", + "Antarctica", + "Antigua", + "Argentina", + "Armenia", + "Aruba", + "Australia", + "Austria", + "Azerbaijan", + "Bahamas", + "Bahrain", + "Bangladesh", + "Barbados", + "Belarus", + "Belgium", + "Belize", + "Benin", + "Bermuda", + "Bhutan", + "Bolivia", + "Bosnia", + "Botswana", + "Bouvet Island", + "Brazil", + "British Indian Ocean Territories", + "Brunei Darussalam", + "Bulgaria", + "Burkina Faso", + "Burundi", + "Cambodia", + "Cameroon", + "Canada", + "Cape Verde", + "Cayman", + "Central African Republic", + "Chad", + "Chile", + "China", + "Christmas Island", + "Cocos Islands", + "Colombia", + "Comoros", + "Congo", + "Democratic Republic of the Congo", + "Cook Islands", + "Costa Rica", + "Ivory Coast", + "Croatia", + "Cuba", + "Cyprus", + "Czech Republic", + "Denmark", + "Djibouti", + "Dominica", + "Dominican Republic", + "Ecuador", + "Egypt", + "El Salvador", + "Equatorial Guinea", + "Eritrea", + "Estonia", + "Ethiopia", + "Falkland Islands", + "Faroe Islands", + "Fiji", + "Finland", + "France", + "French Guiana", + "French Polynesia", + "French Southern Territories", + "Gabon", + "Gambia", + "Georgia", + "Germany", + "Ghana", + "Gibraltar", + "Greece", + "Greenland", + "Grenada", + "Guadeloupe", + "Guatemala", + "Guinea", + "Guinea-Bissau", + "Guyana", + "Haiti", + "Heard Island", + "Honduras", + "Hong Kong", + "Hungary", + "Iceland", + "India", + "Indonesia", + "Iran", + "Iraq", + "Ireland", + "Israel", + "Italy", + "Jamaica", + "Japan", + "Jordan", + "Kazakhstan", + "Kenya", + "Kiribati", + "North Korea", + "South Korea", + "Kuwait", + "Kyrgyzstan", + "Laos", + "Latvia", + "Lebanon", + "Lesotho", + "Liberia", + "Libya", + "Liechtenstein", + "Lithuania", + "Luxembourg", + "Macao", + "Macedonia", + "Madagascar", + "Malawi", + "Malaysia", + "Maldives", + "Mali", + "Malta", + "Martinique", + "Mauritania", + "Mauritius", + "Mayotte", + "Mexico", + "Micronesia", + "Moldova", + "Monaco", + "Mongolia", + "Montserrat", + "Morocco", + "Mozambique", + "Myanmar", + "Namibia", + "Nauru", + "Nepal", + "Netherlands Antilles", + "Netherlands", + "New Caledonia", + "New Zealand", + "Nicaragua", + "Niger", + "Nigeria", + "Niue", + "Norfolk", + "Norway", + "Oman", + "Pakistan", + "Panama", + "Papua New Guinea", + "Paraguay", + "Peru", + "Philippines", + "Pitcairn", + "Poland", + "Portugal", + "Qatar", + "Reunion", + "Romania", + "Russia", + "Rwanda", + "Saint Helena", + "Saint Kitts and Nevis", + "Saint Lucia", + "Saint Pierre and Miquelon", + "Saint Vincent and the Grenadines", + "San Marino", + "Sao Tome and Principe", + "Saudi Arabia", + "Senegal", + "Serbia", + "Seychelles", + "Sierra Leone", + "Singapore", + "Slovakia", + "Slovenia", + "Solomon Islands", + "Somalia", + "South Africa", + "South Georgia and the South Sandwich Islands", + "Spain", + "Sri Lanka", + "Sudan", + "Suriname", + "Swaziland", + "Sweden", + "Switzerland", + "Syrian Arab Republic", + "Taiwan", + "Tajikistan", + "Tanzania", + "Thailand", + "Timor-Leste", + "Togo", + "Tokelau", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Turkmenistan", + "Turks and Caicos Islands", + "Tuvalu", + "Uganda", + "Ukraine", + "United Arab Emirates", + "United Kingdom", + "Uruguay", + "Uzbekistan", + "Vanuatu", + "Vatican", + "Venezuela", + "Vietnam", + "British Virgin Islands", + "Wallis and Futuna", + "Western Sahara", + "Yemen", + "Zambia", + "Zimbabwe" + ] + }, + "street": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "street2": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "street3": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "city": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "state": { + "type": "string" + }, + "postalCode": { + "type": "string" + } + } + } + } + }, + "debtInformation": { + "type": "array", + "items": { + "type": "object", + "properties": { + "debt": { + "type": "string" + }, + "disputeReason": { + "type": "string" + }, + "supportStatement": { + "type": "string" + } + } + } + } + }, + "required": [ + "email", + "phoneNumber", + "address", + "debt", + "disputeReason", + "supportStatement" + ] +} diff --git a/package.json b/package.json index aa572fa5..ada631a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vets-json-schema", - "version": "24.6.0", + "version": "24.7.1", "license": "CC0-1.0", "repository": { "type": "git", diff --git a/src/schemas/21P-527EZ/schema.js b/src/schemas/21P-527EZ/schema.js index 6973aaf3..223330eb 100644 --- a/src/schemas/21P-527EZ/schema.js +++ b/src/schemas/21P-527EZ/schema.js @@ -333,6 +333,9 @@ const schema = { statementOfTruthSignature: { type: 'string', }, + signatureDate: { + type: 'string', + }, }, required: ['veteranFullName', 'veteranAddress', 'statementOfTruthCertified', 'statementOfTruthSignature'], }; diff --git a/src/schemas/22-10216/schema.js b/src/schemas/22-10216/schema.js new file mode 100644 index 00000000..ae5c9f9c --- /dev/null +++ b/src/schemas/22-10216/schema.js @@ -0,0 +1,50 @@ +import _ from 'lodash'; +import definitions from '../../common/definitions'; + +const origDefinitions = _.cloneDeep(definitions); + +const pickedDefinitions = _.pick(origDefinitions, ['date']); + +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + title: '22-10216 5% EXEMPTION REQUEST FROM 85/15 REPORTING REQUIREMENT GENERAL INFORMATION (22-10216)', + type: 'object', + additionalProperties: false, + definitions: pickedDefinitions, + properties: { + institutionDetails: { + type: 'object', + required: ['institutionName', 'facilityCode', 'termStartDate'], + properties: { + institutionName: { + type: 'string', + }, + facilityCode: { + type: 'string', + }, + termStartDate: { + $ref: '#/definitions/date', + }, + }, + }, + studentRatioCalcChapter: { + type: 'object', + required: ['beneficiaryStudent', 'numOfStudent', 'dateOfCalculation'], + properties: { + beneficiaryStudent: { + type: 'integer', + }, + numOfStudent: { + type: 'integer', + }, + VaBeneficiaryStudentsPercentage: { + type: 'number', + }, + dateOfCalculation: { + $ref: '#/definitions/date', + }, + }, + }, + }, +}; +export default schema; diff --git a/src/schemas/DISPUTE-DEBT/schema.js b/src/schemas/DISPUTE-DEBT/schema.js new file mode 100644 index 00000000..2b95fdaa --- /dev/null +++ b/src/schemas/DISPUTE-DEBT/schema.js @@ -0,0 +1,37 @@ +import definitions from '../../common/definitions'; + +const schema = { + $schema: 'http://json-schema.org/draft-04/schema#', + title: 'DISPUTE DEBT', + type: 'object', + properties: { + contactInformation: { + type: 'object', + properties: { + email: definitions.email, + phoneNumber: definitions.phoneNumber, + address: definitions.profileAddress, + }, + }, + debtInformation: { + type: 'array', + items: { + type: 'object', + properties: { + debt: { + type: 'string', + }, + disputeReason: { + type: 'string', + }, + supportStatement: { + type: 'string', + }, + }, + }, + }, + }, + required: ['email', 'phoneNumber', 'address', 'debt', 'disputeReason', 'supportStatement'], +}; + +export default schema; diff --git a/test/schemas/22-10216/schema.spec.js b/test/schemas/22-10216/schema.spec.js new file mode 100644 index 00000000..7c411fa7 --- /dev/null +++ b/test/schemas/22-10216/schema.spec.js @@ -0,0 +1,65 @@ +import { expect } from 'chai'; +import { it } from 'mocha'; +import { cloneDeep } from 'lodash'; +import schema from '../../../src/schemas/22-10216/schema'; +import SchemaTestHelper from '../../support/schema-test-helper'; + +const schemaWithoutRequired = cloneDeep(schema); + +const schemaTestHelper = new SchemaTestHelper(schemaWithoutRequired); + +const testData = { + institutionDetails: { + valid: [ + { + institutionName: 'Test Institution', + facilityCode: '12345678', + termStartDate: '2024-01-01', + }, + ], + invalid: [ + { + institutionName: 'Test Institution', + facilityCode: '12345f6g', + termStartDate: '2024-01-01', + }, + ], + }, + studentRatioCalcChapter: { + valid: [ + { + beneficiaryStudent: 1, + numOfStudent: 1, + dateOfCalculation: '2024-01-01', + }, + ], + invalid: [ + { + beneficiaryStudent: '1r', + numOfStudent: '1r', + dateOfCalculation: '20230101', + }, + { + institutionName: 'Institution of Test', + facilityCode: 'IoT 123', + termStartDate: 'start date', + }, + ], + }, +}; +describe('10216 schema', () => { + it('should have required fields', () => { + expect(schema.properties.institutionDetails.required).to.deep.equal([ + 'institutionName', + 'facilityCode', + 'termStartDate', + ]); + expect(schema.properties.studentRatioCalcChapter.required).to.deep.equal([ + 'beneficiaryStudent', + 'numOfStudent', + 'dateOfCalculation', + ]); + schemaTestHelper.testValidAndInvalid('institutionDetails', testData.institutionDetails); + schemaTestHelper.testValidAndInvalid('studentRatioCalcChapter', testData.studentRatioCalcChapter); + }); +});