diff --git a/dist/21P-527EZ-schema.json b/dist/21P-527EZ-schema.json index 68789cf32..d4aef398c 100644 --- a/dist/21P-527EZ-schema.json +++ b/dist/21P-527EZ-schema.json @@ -53,151 +53,151 @@ "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "type": "string" }, - "netWorth": { - "type": "object", - "required": [ - "bank", - "interestBank", - "ira", - "stocks", - "realProperty" - ], - "properties": { - "bank": { - "type": "number", - "default": 0 - }, - "interestBank": { - "type": "number", - "default": 0 - }, - "ira": { - "type": "number", - "default": 0 - }, - "stocks": { - "type": "number", - "default": 0 - }, - "realProperty": { - "type": "number", - "default": 0 - }, - "additionalSources": { - "$ref": "#/definitions/additionalSources" - } - } - }, - "additionalSources": { + "incomeSources": { "type": "array", "items": { "type": "object", "required": [ - "name" + "typeOfIncome", + "receiver", + "payer", + "amount" ], "properties": { - "name": { + "typeOfIncome": { + "type": "string", + "enum": [ + "SOCIAL_SECURITY", + "INTEREST_DIVIDEND", + "RETIREMENT", + "PENSION", + "OTHER" + ] + }, + "otherTypeExplanation": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "childName": { + "type": "string" + }, + "payer": { "type": "string" }, "amount": { - "type": "number" + "type": "number", + "default": 0 } } } }, - "monthlyIncome": { - "type": "object", - "required": [ - "socialSecurity", - "civilService", - "railroad", - "blackLung", - "serviceRetirement", - "ssi" - ], - "properties": { - "socialSecurity": { - "type": "number", - "default": 0 - }, - "civilService": { - "type": "number", - "default": 0 - }, - "railroad": { - "type": "number", - "default": 0 - }, - "blackLung": { - "type": "number", - "default": 0 - }, - "serviceRetirement": { - "type": "number", - "default": 0 - }, - "ssi": { - "type": "number", - "default": 0 - }, - "additionalSources": { - "$ref": "#/definitions/additionalSources" - } - } - }, - "expectedIncome": { - "type": "object", - "required": [ - "salary", - "interest" - ], - "properties": { - "salary": { - "type": "number", - "default": 0 - }, - "interest": { - "type": "number", - "default": 0 - }, - "additionalSources": { - "$ref": "#/definitions/additionalSources" + "careExpenses": { + "type": "array", + "items": { + "type": "object", + "required": [ + "recipients", + "provider", + "careType", + "paymentFrequency", + "paymentAmount" + ], + "properties": { + "recipients": { + "type": "string", + "enum": [ + "VETERAN", + "SPOUSE", + "CHILD" + ] + }, + "childName": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "careType": { + "type": "string", + "enum": [ + "CARE_FACILITY", + "IN_HOME_CARE_PROVIDER" + ] + }, + "ratePerHour": { + "type": "number" + }, + "hoursPerWeek": { + "type": "number" + }, + "careDateRange": { + "$ref": "#/definitions/dateRange" + }, + "noCareEndDate": { + "type": "boolean" + }, + "paymentFrequency": { + "type": "string", + "enum": [ + "ONCE_MONTH", + "ONCE_YEAR" + ] + }, + "paymentAmount": { + "type": "number" + } } } }, - "otherExpenses": { + "medicalExpenses": { "type": "array", - "minItems": 1, "items": { "type": "object", "required": [ - "amount", + "recipients", + "provider", "purpose", - "paidTo", - "date" + "paymentDate", + "paymentFrequency", + "paymentAmount" ], "properties": { - "amount": { - "type": "number" + "recipients": { + "type": "string", + "enum": [ + "VETERAN", + "SPOUSE", + "CHILD" + ] }, - "purpose": { + "childName": { + "type": "string" + }, + "provider": { "type": "string" }, - "paidTo": { + "purpose": { "type": "string" }, - "date": { + "paymentDate": { "$ref": "#/definitions/date" + }, + "paymentFrequency": { + "type": "string", + "enum": [ + "ONCE_MONTH", + "ONCE_YEAR", + "ONE_TIME" + ] + }, + "paymentAmount": { + "type": "number" } } } }, - "privacyAgreementAccepted": { - "type": "boolean", - "enum": [ - true - ] - }, "fullName": { "type": "object", "properties": { @@ -733,146 +733,199 @@ "type": "string", "format": "email" }, - "altEmail": { - "type": "string", - "format": "email" - }, - "spouseIsVeteran": { - "type": "boolean" - }, - "liveWithSpouse": { + "vaClaimsHistory": { "type": "boolean" }, - "reasonForNotLivingWithSpouse": { + "internationalPhone": { "type": "string" }, - "monthlySpousePayment": { - "type": "number" - }, - "servicePeriods": { - "type": "array", - "items": { - "type": "object", - "properties": { - "serviceBranch": { - "type": "string" - }, - "activeServiceDateRange": { - "$ref": "#/definitions/dateRange" - } + "serviceBranch": { + "type": "object", + "properties": { + "army": { + "type": "boolean" + }, + "navy": { + "type": "boolean" + }, + "airForce": { + "type": "boolean" + }, + "coastGuard": { + "type": "boolean" + }, + "marineCorps": { + "type": "boolean" + }, + "spaceForce": { + "type": "boolean" + }, + "usphs": { + "type": "boolean" + }, + "noaa": { + "type": "boolean" } } }, + "activeServiceDateRange": { + "$ref": "#/definitions/dateRange" + }, + "serviceNumber": { + "type": "string" + }, + "serveUnderOtherNames": { + "type": "boolean" + }, "previousNames": { "type": "array", "items": { "$ref": "#/definitions/fullName" } }, - "combatSince911": { - "type": "boolean" + "placeOfSeparation": { + "type": "string" }, "noRapidProcessing": { "type": "boolean" }, - "noBankAccount": { + "powStatus": { + "type": "boolean" + }, + "isOver65": { + "type": "boolean" + }, + "socialSecurityDisability": { + "type": "boolean" + }, + "medicalCondition": { + "type": "boolean" + }, + "nursingHome": { + "type": "boolean" + }, + "medicaidCoverage": { + "type": "boolean" + }, + "medicaidStatus": { + "type": "boolean" + }, + "specialMonthlyPension": { "type": "boolean" }, - "nationalGuardActivation": { + "vaTreatmentHistory": { "type": "boolean" }, - "vamcTreatmentCenters": { + "vaMedicalCenters": { "type": "array", "items": { "type": "object", "required": [ - "location" + "medicalCenter" ], "properties": { - "location": { + "medicalCenter": { "type": "string" } } } }, - "nationalGuard": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "address": { - "$ref": "#/definitions/address" - }, - "phone": { - "$ref": "#/definitions/usaPhone" - }, - "date": { - "$ref": "#/definitions/date" - } - } + "federalTreatmentHistory": { + "type": "boolean" }, - "severancePay": { - "type": "object", - "properties": { - "amount": { - "type": "number" - }, - "type": { - "type": "string", - "enum": [ - "Longevity", - "Separation", - "Severance", - "PDRL", - "TDRL" - ] + "federalMedicalCenters": { + "type": "array", + "items": { + "type": "object", + "required": [ + "medicalCenter" + ], + "properties": { + "medicalCenter": { + "type": "string" + } } } }, - "placeOfSeparation": { - "type": "string" + "currentEmployment": { + "type": "boolean" }, - "disabilities": { + "currentEmployers": { "type": "array", "items": { "type": "object", + "required": [ + "jobType", + "jobHoursWeek", + "jobTitle" + ], "properties": { - "name": { + "jobType": { "type": "string" }, - "disabilityStartDate": { - "$ref": "#/definitions/date" + "jobHoursWeek": { + "type": "number" + }, + "jobTitle": { + "type": "string" } } } }, - "jobs": { + "previousEmployers": { "type": "array", "items": { "type": "object", + "required": [ + "jobType", + "jobHoursWeek", + "jobTitle" + ], "properties": { - "employer": { - "type": "string" - }, - "address": { - "$ref": "#/definitions/address" + "jobDate": { + "$ref": "#/definitions/date" }, - "jobTitle": { + "jobType": { "type": "string" }, - "dateRange": { - "$ref": "#/definitions/dateRange" + "jobHoursWeek": { + "type": "number" }, - "daysMissed": { + "jobTitle": { "type": "string" - }, - "annualEarnings": { - "type": "number" } } } }, + "marriageHistory": { + "$ref": "#/definitions/marriages" + }, + "spouseIsVeteran": { + "type": "boolean" + }, + "liveWithSpouse": { + "type": "boolean" + }, + "reasonForCurrentSeparation": { + "type": "string" + }, + "otherExplanation": { + "type": "string" + }, + "reasonForNotLivingWithSpouse": { + "type": "string" + }, + "currentSpouseMonthlySupport": { + "type": "number" + }, + "currentSpouseMaritalHistory": { + "type": "string", + "enum": [ + "Yes", + "No", + "I’m not sure" + ] + }, "dependents": { "type": "array", "items": { @@ -896,18 +949,6 @@ "monthlyPayment": { "type": "number" }, - "monthlyIncome": { - "$ref": "#/definitions/monthlyIncome" - }, - "expectedIncome": { - "$ref": "#/definitions/expectedIncome" - }, - "netWorth": { - "$ref": "#/definitions/netWorth" - }, - "otherExpenses": { - "$ref": "#/definitions/otherExpenses" - }, "childPlaceOfBirth": { "type": "string" }, @@ -928,17 +969,56 @@ "disabled": { "type": "boolean" }, - "married": { - "type": "boolean" - }, "previouslyMarried": { "type": "boolean" } } } }, - "privacyAgreementAccepted": { - "$ref": "#/definitions/privacyAgreementAccepted" + "totalNetWorth": { + "type": "boolean" + }, + "netWorthEstimation": { + "type": "number" + }, + "transferredAssets": { + "type": "boolean" + }, + "homeOwnership": { + "type": "boolean" + }, + "homeAcreageMoreThanTwo": { + "type": "boolean" + }, + "homeAcreageValue": { + "type": "number" + }, + "landMarketable": { + "type": "boolean" + }, + "receivesIncome": { + "type": "boolean" + }, + "incomeSources": { + "$ref": "#/definitions/incomeSources" + }, + "hasCareExpenses": { + "type": "boolean" + }, + "careExpenses": { + "$ref": "#/definitions/careExpenses" + }, + "hasMedicalExpenses": { + "type": "boolean" + }, + "medicalExpenses": { + "$ref": "#/definitions/medicalExpenses" + }, + "statementOfTruthCertified": { + "type": "boolean" + }, + "statementOfTruthSignature": { + "type": "string" }, "veteranFullName": { "$ref": "#/definitions/fullName" @@ -958,6 +1038,9 @@ "nightPhone": { "$ref": "#/definitions/usaPhone" }, + "phone": { + "$ref": "#/definitions/usaPhone" + }, "mobilePhone": { "$ref": "#/definitions/usaPhone" }, @@ -991,30 +1074,6 @@ "spouseMarriages": { "$ref": "#/definitions/marriages" }, - "netWorth": { - "$ref": "#/definitions/netWorth" - }, - "monthlyIncome": { - "$ref": "#/definitions/monthlyIncome" - }, - "expectedIncome": { - "$ref": "#/definitions/expectedIncome" - }, - "otherExpenses": { - "$ref": "#/definitions/otherExpenses" - }, - "spouseNetWorth": { - "$ref": "#/definitions/netWorth" - }, - "spouseMonthlyIncome": { - "$ref": "#/definitions/monthlyIncome" - }, - "spouseExpectedIncome": { - "$ref": "#/definitions/expectedIncome" - }, - "spouseOtherExpenses": { - "$ref": "#/definitions/otherExpenses" - }, "bankAccount": { "$ref": "#/definitions/bankAccount" }, @@ -1023,7 +1082,6 @@ } }, "required": [ - "privacyAgreementAccepted", "veteranFullName", "veteranAddress" ] diff --git a/package.json b/package.json index 930cabf2c..44e149ae5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vets-json-schema", - "version": "20.33.6", + "version": "20.33.7", "repository": { "type": "git", "url": "git+https://github.com/department-of-veterans-affairs/vets-json-schema.git" @@ -55,4 +55,4 @@ "dependencies": { "minimist": "^1.2.3" } -} \ No newline at end of file +} diff --git a/src/schemas/21P-527EZ/schema.js b/src/schemas/21P-527EZ/schema.js index 81e53d67e..f21573051 100644 --- a/src/schemas/21P-527EZ/schema.js +++ b/src/schemas/21P-527EZ/schema.js @@ -28,76 +28,70 @@ const schema = { pattern: '^\\d{4}-\\d{2}-\\d{2}$', type: 'string', }, - netWorth: { - type: 'object', - required: ['bank', 'interestBank', 'ira', 'stocks', 'realProperty'], - properties: { - bank: financialNumber, - interestBank: financialNumber, - ira: financialNumber, - stocks: financialNumber, - realProperty: financialNumber, - additionalSources: { $ref: '#/definitions/additionalSources' }, - }, - }, - additionalSources: { + incomeSources: { type: 'array', items: { type: 'object', - required: ['name'], + required: ['typeOfIncome', 'receiver', 'payer', 'amount'], properties: { - name: { + typeOfIncome: { type: 'string', + enum: ['SOCIAL_SECURITY', 'INTEREST_DIVIDEND', 'RETIREMENT', 'PENSION', 'OTHER'], }, - amount: { - type: 'number', + otherTypeExplanation: { + type: 'string', + }, + receiver: { + type: 'string', }, + childName: { + type: 'string', + }, + payer: { + type: 'string', + }, + amount: financialNumber, }, }, }, - monthlyIncome: { - type: 'object', - required: ['socialSecurity', 'civilService', 'railroad', 'blackLung', 'serviceRetirement', 'ssi'], - properties: { - socialSecurity: financialNumber, - civilService: financialNumber, - railroad: financialNumber, - blackLung: financialNumber, - serviceRetirement: financialNumber, - ssi: financialNumber, - additionalSources: { $ref: '#/definitions/additionalSources' }, - }, - }, - expectedIncome: { - type: 'object', - required: ['salary', 'interest'], - properties: { - salary: financialNumber, - interest: financialNumber, - additionalSources: { - $ref: '#/definitions/additionalSources', + careExpenses: { + type: 'array', + items: { + type: 'object', + required: ['recipients', 'provider', 'careType', 'paymentFrequency', 'paymentAmount'], + properties: { + recipients: { + type: 'string', + enum: ['VETERAN', 'SPOUSE', 'CHILD'], + }, + childName: { type: 'string' }, + provider: { type: 'string' }, + careType: { type: 'string', enum: ['CARE_FACILITY', 'IN_HOME_CARE_PROVIDER'] }, + ratePerHour: { type: 'number' }, + hoursPerWeek: { type: 'number' }, + careDateRange: schemaHelpers.getDefinition('dateRange'), + noCareEndDate: { type: 'boolean' }, + paymentFrequency: { type: 'string', enum: ['ONCE_MONTH', 'ONCE_YEAR'] }, + paymentAmount: { type: 'number' }, }, }, }, - otherExpenses: { + medicalExpenses: { type: 'array', - minItems: 1, items: { type: 'object', - required: ['amount', 'purpose', 'paidTo', 'date'], + required: ['recipients', 'provider', 'purpose', 'paymentDate', 'paymentFrequency', 'paymentAmount'], properties: { - amount: { - type: 'number', - }, - purpose: { - type: 'string', - }, - paidTo: { + recipients: { type: 'string', + enum: ['VETERAN', 'SPOUSE', 'CHILD'], }, - date: { - $ref: '#/definitions/date', - }, + childName: { type: 'string' }, + provider: { type: 'string' }, + purpose: { type: 'string' }, + paymentDate: { $ref: '#/definitions/date' }, + paymentFrequency: { type: 'string', enum: ['ONCE_MONTH', 'ONCE_YEAR', 'ONE_TIME'] }, + paymentAmount: { type: 'number' }, }, }, }, @@ -107,124 +101,141 @@ const schema = { type: 'string', format: 'email', }, - altEmail: { - type: 'string', - format: 'email', - }, - spouseIsVeteran: { + vaClaimsHistory: { type: 'boolean', }, - liveWithSpouse: { - type: 'boolean', - }, - reasonForNotLivingWithSpouse: { + internationalPhone: { type: 'string', }, - monthlySpousePayment: { - type: 'number', - }, - // 12a-c, but multiple items - servicePeriods: { - type: 'array', - items: { - type: 'object', - properties: { - serviceBranch: { - type: 'string', - }, - activeServiceDateRange: schemaHelpers.getDefinition('dateRange'), - }, + serviceBranch: { + type: 'object', + properties: { + army: { type: 'boolean' }, + navy: { type: 'boolean' }, + airForce: { type: 'boolean' }, + coastGuard: { type: 'boolean' }, + marineCorps: { type: 'boolean' }, + spaceForce: { type: 'boolean' }, + usphs: { type: 'boolean' }, + noaa: { type: 'boolean' }, }, }, + activeServiceDateRange: schemaHelpers.getDefinition('dateRange'), + serviceNumber: { type: 'string' }, + serveUnderOtherNames: { type: 'boolean' }, previousNames: { type: 'array', items: schemaHelpers.getDefinition('fullName'), }, - combatSince911: { - type: 'boolean', + placeOfSeparation: { + type: 'string', }, - // 32. I DO NOT want my claim considered for rapid processing under the FDC Program because I plan to submit further evidence in support of my claim. noRapidProcessing: { type: 'boolean', }, - // 29. I CERTIFY THAT I DO NOT HAVE AN ACCOUNT WITH A FINANCIAL INSTITUTION OR CERTIFIED PAYMENT AGENT - noBankAccount: { - type: 'boolean', - }, - // 13A. ARE YOU CURRENTLY ACTIVATED TO FEDERAL ACTIVE DUTY UNDER THE AUTHORITY OF TITLE 10, U.S.C. (National Guard)? - nationalGuardActivation: { - type: 'boolean', - }, - vamcTreatmentCenters: { + powStatus: { type: 'boolean' }, + isOver65: { type: 'boolean' }, + socialSecurityDisability: { type: 'boolean' }, + medicalCondition: { type: 'boolean' }, + nursingHome: { type: 'boolean' }, + medicaidCoverage: { type: 'boolean' }, + medicaidStatus: { type: 'boolean' }, + specialMonthlyPension: { type: 'boolean' }, + vaTreatmentHistory: { type: 'boolean' }, + vaMedicalCenters: { type: 'array', items: { type: 'object', - required: ['location'], + required: ['medicalCenter'], properties: { - location: { + medicalCenter: { type: 'string', }, }, }, }, - nationalGuard: { - type: 'object', - properties: { - name: { type: 'string' }, - address: schemaHelpers.getDefinition('address'), - phone: schemaHelpers.getDefinition('usaPhone'), - date: schemaHelpers.getDefinition('date'), - }, - }, - // 16A-C. DID YOU RECEIVE ANY TYPE OF SEPARATION/SEVERANCE RETIRED PAY? - severancePay: { - type: 'object', - properties: { - amount: { type: 'number' }, - type: { - type: 'string', - enum: ['Longevity', 'Separation', 'Severance', 'PDRL', 'TDRL'], - }, - }, - }, - placeOfSeparation: { - type: 'string', + federalTreatmentHistory: { + type: 'boolean', }, - disabilities: { + federalMedicalCenters: { type: 'array', items: { type: 'object', + required: ['medicalCenter'], properties: { - name: { + medicalCenter: { type: 'string', }, - disabilityStartDate: schemaHelpers.getDefinition('date'), }, }, }, - jobs: { + currentEmployment: { + type: 'boolean', + }, + currentEmployers: { type: 'array', items: { type: 'object', + required: ['jobType', 'jobHoursWeek', 'jobTitle'], properties: { - employer: { + jobType: { type: 'string', }, - address: schemaHelpers.getDefinition('address'), + jobHoursWeek: { + type: 'number', + }, jobTitle: { type: 'string', }, - dateRange: schemaHelpers.getDefinition('dateRange'), - daysMissed: { - // making this a string so people can answer in words if they don't know the exact number of days + }, + }, + }, + previousEmployers: { + type: 'array', + items: { + type: 'object', + required: ['jobType', 'jobHoursWeek', 'jobTitle'], + properties: { + jobDate: { + $ref: '#/definitions/date', + }, + jobType: { type: 'string', }, - annualEarnings: { + jobHoursWeek: { type: 'number', }, + jobTitle: { + type: 'string', + }, }, }, }, + marriageHistory: { + $ref: '#/definitions/marriages', + }, + spouseIsVeteran: { + type: 'boolean', + }, + liveWithSpouse: { + type: 'boolean', + }, + reasonForCurrentSeparation: { + type: 'string', + }, + otherExplanation: { + type: 'string', + }, + reasonForNotLivingWithSpouse: { + type: 'string', + }, + currentSpouseMonthlySupport: { + type: 'number', + }, + currentSpouseMaritalHistory: { + type: 'string', + enum: ['Yes', 'No', 'I’m not sure'], + }, dependents: { type: 'array', items: { @@ -240,10 +251,6 @@ const schema = { monthlyPayment: { type: 'number', }, - monthlyIncome: { $ref: '#/definitions/monthlyIncome' }, - expectedIncome: { $ref: '#/definitions/expectedIncome' }, - netWorth: { $ref: '#/definitions/netWorth' }, - otherExpenses: { $ref: '#/definitions/otherExpenses' }, childPlaceOfBirth: { type: 'string', }, @@ -258,27 +265,69 @@ const schema = { disabled: { type: 'boolean', }, - married: { - type: 'boolean', - }, previouslyMarried: { type: 'boolean', }, }, }, }, + totalNetWorth: { + type: 'boolean', + }, + netWorthEstimation: { + type: 'number', + }, + transferredAssets: { + type: 'boolean', + }, + homeOwnership: { + type: 'boolean', + }, + homeAcreageMoreThanTwo: { + type: 'boolean', + }, + homeAcreageValue: { + type: 'number', + }, + landMarketable: { + type: 'boolean', + }, + receivesIncome: { + type: 'boolean', + }, + incomeSources: { + $ref: '#/definitions/incomeSources', + }, + hasCareExpenses: { + type: 'boolean', + }, + careExpenses: { + $ref: '#/definitions/careExpenses', + }, + hasMedicalExpenses: { + type: 'boolean', + }, + medicalExpenses: { + $ref: '#/definitions/medicalExpenses', + }, + statementOfTruthCertified: { + type: 'boolean', + }, + statementOfTruthSignature: { + type: 'string', + }, }, - required: ['privacyAgreementAccepted', 'veteranFullName', 'veteranAddress'], + required: ['veteranFullName', 'veteranAddress'], }; [ - ['privacyAgreementAccepted'], ['fullName', 'veteranFullName'], ['ssn', 'veteranSocialSecurityNumber'], ['centralMailVaFile', 'vaFileNumber'], ['centralMailAddress', 'veteranAddress'], ['usaPhone', 'dayPhone'], ['usaPhone', 'nightPhone'], + ['usaPhone', 'phone'], ['usaPhone', 'mobilePhone'], ['maritalStatus'], ['gender'], @@ -290,14 +339,6 @@ const schema = { ['address', 'spouseAddress'], ['marriages'], ['marriages', 'spouseMarriages'], - ['netWorth'], - ['monthlyIncome'], - ['expectedIncome'], - ['otherExpenses'], - ['netWorth', 'spouseNetWorth'], - ['monthlyIncome', 'spouseMonthlyIncome'], - ['expectedIncome', 'spouseExpectedIncome'], - ['otherExpenses', 'spouseOtherExpenses'], ['bankAccount'], ['files'], ].forEach(args => { diff --git a/test/schemas/21P-527EZ/schema.spec.js b/test/schemas/21P-527EZ/schema.spec.js index 89416ed94..ef1c9c717 100644 --- a/test/schemas/21P-527EZ/schema.spec.js +++ b/test/schemas/21P-527EZ/schema.spec.js @@ -15,19 +15,18 @@ let sharedTests = new SharedTests(schemaTestHelper); describe('21-527 schema', () => { [ - 'maritalStatus', - 'gender' + 'maritalStatus' ].forEach((test) => { sharedTests.runTest(test); }); it('should have the right required fields', () => { - expect(schema.required).to.deep.equal(['privacyAgreementAccepted', 'veteranFullName', 'veteranAddress']); + expect(schema.required).to.deep.equal(['veteranFullName', 'veteranAddress']); }); - sharedTests.runTest('usaPhone', ['dayPhone', 'nightPhone', 'mobilePhone', 'nationalGuard.phone']); + sharedTests.runTest('usaPhone', ['phone', 'dayPhone', 'nightPhone', 'mobilePhone']); - sharedTests.runTest('email', ['email', 'altEmail']); + sharedTests.runTest('email', ['email']); sharedTests.runTest('fullName', ['veteranFullName']); @@ -41,11 +40,11 @@ describe('21-527 schema', () => { sharedTests.runTest('centralMailAddress', ['veteranAddress']); - sharedTests.runTest('marriages', ['marriages', 'spouseMarriages']); + sharedTests.runTest('marriages', ['marriages']); sharedTests.runTest('files', ['files']); - ['spouseDateOfBirth', 'veteranDateOfBirth', 'nationalGuard.date'].forEach((field) => { + ['spouseDateOfBirth', 'veteranDateOfBirth'].forEach((field) => { schemaTestHelper.testValidAndInvalid(field, { valid: ['1990-01-01'], invalid: ['1/1/1990'] @@ -68,42 +67,10 @@ describe('21-527 schema', () => { childAddress: fixtures.address, personWhoLivesWithChild: fixtures.fullName, monthlyPayment: 1, - monthlyIncome: { - socialSecurity: 1, - railroad: 1, - blackLung: 0, - serviceRetirement: 0, - civilService: 5, - ssi: 1, - additionalSources: [{ - name: 'Something', - amount: 1 - }] - }, - netWorth: { - bank: 2, - ira: 2, - stocks: 2, - interestBank: 2, - realProperty: 123 - } }]], invalid: [[{ fullName: 1, - monthlyIncome: { - civilService: 'what' - }, - netWorth: { - additionalSources: [{ - name: 1 - }] - } - }], - [{ - netWorth: { - additionalSources: [{}] - } - }]] + }]], }); schemaTestHelper.testValidAndInvalid('bankAccount', { @@ -123,111 +90,40 @@ describe('21-527 schema', () => { invalid: [[false]] }); - schemaTestHelper.testValidAndInvalid('disabilities', { + schemaTestHelper.testValidAndInvalid('currentEmployers', { valid: [[{ - name: 'polio', - disabilityStartDate: fixtures.date - }]], - invalid: [[{ - name: false - }]] - }); - - schemaTestHelper.testValidAndInvalid('jobs', { - valid: [[{ - employer: 'foo corp', - address: fixtures.address, + jobType: 'analyst', + jobHoursWeek: 40, jobTitle: 'analyst', - dateRange: fixtures.dateRange, - daysMissed: '1 month', - annualEarnings: 12 }]], invalid: [[{ - employer: 1 + jobType: 1, + jobHoursWeek: '40', + jobTitle: 234, }]] }); - schemaTestHelper.testValidAndInvalid('servicePeriods', { + schemaTestHelper.testValidAndInvalid('previousEmployers', { valid: [[{ - activeServiceDateRange: fixtures.dateRange, - serviceBranch: 'Army' + jobDate: '2020-01-01', + jobType: 'analyst', + jobHoursWeek: 40, + jobTitle: 'analyst', }]], invalid: [[{ - activeServiceDateRange: fixtures.dateRange, - serviceBranch: 3 + jobDate: '2020/01/01', + jobType: 1, + jobHoursWeek: '40', + jobTitle: 234, }]] }); - schemaTestHelper.testValidAndInvalid('vamcTreatmentCenters', { + schemaTestHelper.testValidAndInvalid('vaMedicalCenters', { valid: [[{ - location: 'Maryland' + medicalCenter: 'Maryland' }]], invalid: [[{ - location: 3 - }]] - }); - - schemaTestHelper.testValidAndInvalid('expectedIncome', { - valid: [{ - salary: 1, - interest: 2, - additionalSources: [fixtures.otherIncome] - }], - invalid: [{ - salary: true - }] - }); - - schemaTestHelper.testValidAndInvalid('monthlyIncome',{ - valid: [{ - relationshipAndChildName: fixtures.relationshipAndChildName, - socialSecurity: 1, - civilService: 1, - railroad: 0, - serviceRetirement: 0, - blackLung: 0, - ssi: 1, - otherIncome: fixtures.otherIncome - }], - invalid: [[{ - ssi: false + medicalCenter: 3 }]] }); - - schemaTestHelper.testValidAndInvalid('nationalGuard',{ - valid: [{ - name: 'unit 123', - address: fixtures.address, - phone: '0123456789', - date: fixtures.date - }], - invalid: [[{ - name: false - }]] - }); - - schemaTestHelper.testValidAndInvalid('severancePay',{ - valid: [{ - amount: 123, - type: 'Longevity' - }], - invalid: [[{ - amount: false - }]] - }); - - ['otherExpenses', 'spouseOtherExpenses'] - .forEach(field => { - schemaTestHelper.testValidAndInvalid(field, { - valid: [[{ - amount: 1, - date: fixtures.date, - purpose: 'doctor', - paidTo: 'doctor' - }]], - invalid: [[{ - amount: false - }]] - }); - }); });