From 6fbb42ea8933781da3d1e486bf592016d59a1bf0 Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Fri, 1 Nov 2024 16:41:58 -0500 Subject: [PATCH 01/12] First pass at 2122 --- src/schemas/21-22/schema.js | 63 ++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/src/schemas/21-22/schema.js b/src/schemas/21-22/schema.js index a8c150be..d6fb45c7 100644 --- a/src/schemas/21-22/schema.js +++ b/src/schemas/21-22/schema.js @@ -20,33 +20,54 @@ const schema = { })(), veteranFullName: definitions.hcaFullName, veteranSocialSecurityNumber: definitions.ssn, - gender: { - type: 'string', - enum: constants.genders.map(option => option.value), - }, + veteranVaFileNumber: definitions.vaFileNumber, veteranDateOfBirth: { $ref: '#/definitions/date', }, - maritalStatus: definitions.maritalStatus, - veteranAddress: definitions.hcaAddress, - veteranHomeAddress: definitions.hcaAddress, - email: definitions.hcaEmail, - homePhone: definitions.hcaPhone, - mobilePhone: definitions.hcaPhone, - - lastServiceBranch: { - type: 'string', - enum: constants.branchesServed.map(option => option.value), - }, - lastEntryDate: { - $ref: '#/definitions/date', - }, - lastDischargeDate: { + veteranServiceNumber: definitions.veteranServiceNumber, + veteranMailingAddress: definitions.hcaAddress, + veteranPhone: definitions.hcaPhone, + veteranEmail: definitions.hcaEmail, + + claimantFullName: definitions.hcaFullName, + claimantDateOfBirth: { $ref: '#/definitions/date', }, - dischargeType: definitions.dischargeType, + claimantRelationship: definitions.relationship, + claimantMailingAddress: definitions.hcaAddress, + claimantPhone: definitions.hcaPhone, + claimantEmail: definitions.hcaEmail, + + // Fields we need but I'm unsure how to add as of yet: + // Org name - string + // Limitations of consent - Use some kind of enum? - include all option + // Address change authorization - boolean + + + // Does this file need all fields in the PDF, just those we need to + // process the form, or those actually present in the front end form + // experience? + + + + + + + + + + + + + + + + + + + }, - required: ['veteranFullName', 'veteranSocialSecurityNumber', 'veteranDateOfBirth', 'gender', 'veteranAddress'], + required: ['veteranFullName', 'veteranSocialSecurityNumber', 'veteranDateOfBirth', 'veteranMailingAddress', 'veteranPhone'], }; export default schema; From aeb602c2fe7f8e2f492406d284e3627593f3cade Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Fri, 1 Nov 2024 17:08:55 -0500 Subject: [PATCH 02/12] Update 2122a --- src/schemas/21-22A/schema.js | 49 +++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/src/schemas/21-22A/schema.js b/src/schemas/21-22A/schema.js index a8c150be..69e900e4 100644 --- a/src/schemas/21-22A/schema.js +++ b/src/schemas/21-22A/schema.js @@ -20,31 +20,44 @@ const schema = { })(), veteranFullName: definitions.hcaFullName, veteranSocialSecurityNumber: definitions.ssn, - gender: { - type: 'string', - enum: constants.genders.map(option => option.value), - }, + veteranVaFileNumber: definitions.vaFileNumber, veteranDateOfBirth: { $ref: '#/definitions/date', }, - maritalStatus: definitions.maritalStatus, - veteranAddress: definitions.hcaAddress, - veteranHomeAddress: definitions.hcaAddress, - email: definitions.hcaEmail, - homePhone: definitions.hcaPhone, - mobilePhone: definitions.hcaPhone, - - lastServiceBranch: { + veteranServiceNumber: definitions.veteranServiceNumber, + veteranServiceBranch: { type: 'string', - enum: constants.branchesServed.map(option => option.value), - }, - lastEntryDate: { - $ref: '#/definitions/date', }, - lastDischargeDate: { + veteranMailingAddress: definitions.hcaAddress, + veteranPhone: definitions.hcaPhone, + veteranEmail: definitions.hcaEmail, + + claimantFullName: definitions.hcaFullName, + claimantDateOfBirth: { $ref: '#/definitions/date', }, - dischargeType: definitions.dischargeType, + claimantRelationship: definitions.relationship, + claimantMailingAddress: definitions.hcaAddress, + claimantPhone: definitions.hcaPhone, + claimantEmail: definitions.hcaEmail, + + representativeFullName: definitions.hcaFullName, + // representativeIndividualType + representativeMailingAddress: definitions.hcaAddress, + representativePhone: definitions.hcaPhone, + representativeEmail: definitions.hcaEmail, + + // Fields we need but I'm unsure how to add as of yet: + // Org name - string + // Limitations of consent - Use some kind of enum? - include all option + // Address change authorization - boolean + + + // Does this file need all fields in the PDF, just those we need to + // process the form, or those actually present in the front end form + // experience? + + }, required: ['veteranFullName', 'veteranSocialSecurityNumber', 'veteranDateOfBirth', 'gender', 'veteranAddress'], }; From 8011c721079c172cb9019de3919d5ae9b1a29b35 Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Tue, 5 Nov 2024 12:59:32 -0600 Subject: [PATCH 03/12] Start section IV --- src/schemas/21-22/schema.js | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/schemas/21-22/schema.js b/src/schemas/21-22/schema.js index d6fb45c7..7f099db6 100644 --- a/src/schemas/21-22/schema.js +++ b/src/schemas/21-22/schema.js @@ -13,30 +13,39 @@ const schema = { }, type: 'object', properties: { - attachments: (() => { - const attachments = _.cloneDeep(definitions.files); - attachments.items.properties.dd214 = { type: 'boolean' }; - return attachments; - })(), + // Section I Veteran's Information veteranFullName: definitions.hcaFullName, veteranSocialSecurityNumber: definitions.ssn, veteranVaFileNumber: definitions.vaFileNumber, - veteranDateOfBirth: { - $ref: '#/definitions/date', - }, + veteranDateOfBirth: definitions.date, veteranServiceNumber: definitions.veteranServiceNumber, veteranMailingAddress: definitions.hcaAddress, veteranPhone: definitions.hcaPhone, veteranEmail: definitions.hcaEmail, - + // Section II Claimant's Information claimantFullName: definitions.hcaFullName, - claimantDateOfBirth: { - $ref: '#/definitions/date', - }, + claimantDateOfBirth: definitions.date, claimantRelationship: definitions.relationship, claimantMailingAddress: definitions.hcaAddress, claimantPhone: definitions.hcaPhone, claimantEmail: definitions.hcaEmail, + // Section III Service Organization Information + serviceOrganizationName: { type: 'string' }, + serviceOrganizationRepresentativeName: { type: 'string' }, + serviceOrganizationRepresentativeJobTitle: { type: 'string' }, + serviceOrganizationEmail: definitions.hcaEmail, + dateOfAppointment: definitions.date, + // Section IV Authorization Information + authorizationAccessProtectedRecords: { type: 'boolean' }, + limitationsOfConsent: { + type: 'array', + items: { + type: 'string', + enum: ['ALCOHOLISM', 'DRUG_ABUSE', 'HIV', 'SICKLE_CELL'], + } + }, + + // Fields we need but I'm unsure how to add as of yet: // Org name - string From 6b192de79dede353eb398f6e7651b9b1bdf9fea4 Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Tue, 5 Nov 2024 15:44:26 -0600 Subject: [PATCH 04/12] Start breaking up into objects --- src/schemas/21-22/schema.js | 75 ++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/src/schemas/21-22/schema.js b/src/schemas/21-22/schema.js index 7f099db6..0394c771 100644 --- a/src/schemas/21-22/schema.js +++ b/src/schemas/21-22/schema.js @@ -5,36 +5,61 @@ import definitions from '../../common/definitions'; const schema = { $schema: 'http://json-schema.org/draft-04/schema#', title: 'APPLICATION FOR APPOINTING AN ACCREDITED REPRESENTATIVE', - definitions: { - date: { - format: 'date', - type: 'string', - }, - }, type: 'object', properties: { // Section I Veteran's Information - veteranFullName: definitions.hcaFullName, - veteranSocialSecurityNumber: definitions.ssn, - veteranVaFileNumber: definitions.vaFileNumber, - veteranDateOfBirth: definitions.date, - veteranServiceNumber: definitions.veteranServiceNumber, - veteranMailingAddress: definitions.hcaAddress, - veteranPhone: definitions.hcaPhone, - veteranEmail: definitions.hcaEmail, + veteran: { + type: 'object', + properties: { + veteranFullName: definitions.hcaFullName, + veteranSocialSecurityNumber: definitions.ssn, + veteranVaFileNumber: definitions.vaFileNumber, + veteranDateOfBirth: definitions.date, + veteranServiceNumber: definitions.veteranServiceNumber, + veteranMailingAddress: definitions.hcaAddress, + veteranPhone: definitions.hcaPhone, + veteranEmail: definitions.hcaEmail, + }, + required: [ + 'veteranFullName', + 'veteranSocialSecurityNumber', + 'veteranDateOfBirth', + 'veteranMailingAddress', + 'veteranPhone' + ], + }, // Section II Claimant's Information - claimantFullName: definitions.hcaFullName, - claimantDateOfBirth: definitions.date, - claimantRelationship: definitions.relationship, - claimantMailingAddress: definitions.hcaAddress, - claimantPhone: definitions.hcaPhone, - claimantEmail: definitions.hcaEmail, + claimant: { + type: 'object', + properties: { + claimantFullName: definitions.hcaFullName, + claimantDateOfBirth: definitions.date, + claimantRelationship: definitions.relationship, + claimantMailingAddress: definitions.hcaAddress, + claimantPhone: definitions.hcaPhone, + claimantEmail: definitions.hcaEmail, + }, + // If these are required here but the claimant object isn't required at + // the top level, will that match our use case? Our use case being that + // the claimant object isn't required but if it is present, these fields + // are required. + required: [ + 'claimantFullName', + 'claimantDateOfBirth', + 'claimantRelationship', + 'claimantMailingAddress', + 'claimantPhone' + ], + }, // Section III Service Organization Information - serviceOrganizationName: { type: 'string' }, - serviceOrganizationRepresentativeName: { type: 'string' }, - serviceOrganizationRepresentativeJobTitle: { type: 'string' }, - serviceOrganizationEmail: definitions.hcaEmail, - dateOfAppointment: definitions.date, + representative: { + type: 'object', + properties: { + id: { type: 'string' }, + organizationId: { type: 'string' }, + + }, + }, // Section IV Authorization Information authorizationAccessProtectedRecords: { type: 'boolean' }, limitationsOfConsent: { From c0f5f985b2b3e651ac769f1eac4a511c14539fc2 Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Tue, 5 Nov 2024 16:25:50 -0600 Subject: [PATCH 05/12] 2122 ready to go --- src/schemas/21-22/schema.js | 92 ++++++++++++++----------------------- 1 file changed, 34 insertions(+), 58 deletions(-) diff --git a/src/schemas/21-22/schema.js b/src/schemas/21-22/schema.js index 0394c771..1feb8337 100644 --- a/src/schemas/21-22/schema.js +++ b/src/schemas/21-22/schema.js @@ -11,44 +11,44 @@ const schema = { veteran: { type: 'object', properties: { - veteranFullName: definitions.hcaFullName, - veteranSocialSecurityNumber: definitions.ssn, - veteranVaFileNumber: definitions.vaFileNumber, - veteranDateOfBirth: definitions.date, - veteranServiceNumber: definitions.veteranServiceNumber, - veteranMailingAddress: definitions.hcaAddress, - veteranPhone: definitions.hcaPhone, - veteranEmail: definitions.hcaEmail, + name: definitions.hcaFullName, + ssn: definitions.ssn, + vaFileNumber: definitions.vaFileNumber, + dateOfBirth: definitions.date, + serviceNumber: definitions.veteranServiceNumber, + address: definitions.hcaAddress, + phone: definitions.hcaPhone, + email: definitions.hcaEmail, }, required: [ - 'veteranFullName', - 'veteranSocialSecurityNumber', - 'veteranDateOfBirth', - 'veteranMailingAddress', - 'veteranPhone' + 'name', + 'ssn', + 'dateOfBirth', + 'address', + 'phone' ], }, // Section II Claimant's Information claimant: { type: 'object', properties: { - claimantFullName: definitions.hcaFullName, - claimantDateOfBirth: definitions.date, - claimantRelationship: definitions.relationship, - claimantMailingAddress: definitions.hcaAddress, - claimantPhone: definitions.hcaPhone, - claimantEmail: definitions.hcaEmail, + name: definitions.hcaFullName, + dateOfBirth: definitions.date, + relationship: definitions.relationship, + address: definitions.hcaAddress, + phone: definitions.hcaPhone, + email: definitions.hcaEmail, }, // If these are required here but the claimant object isn't required at // the top level, will that match our use case? Our use case being that // the claimant object isn't required but if it is present, these fields // are required. required: [ - 'claimantFullName', - 'claimantDateOfBirth', - 'claimantRelationship', - 'claimantMailingAddress', - 'claimantPhone' + 'name', + 'dateOfBirth', + 'relationship', + 'address', + 'phone' ], }, // Section III Service Organization Information @@ -61,47 +61,23 @@ const schema = { }, }, // Section IV Authorization Information - authorizationAccessProtectedRecords: { type: 'boolean' }, - limitationsOfConsent: { + recordConsent: { type: 'boolean' }, + consentAddressChange: { type: 'boolean' }, + consentLimits: { type: 'array', items: { type: 'string', enum: ['ALCOHOLISM', 'DRUG_ABUSE', 'HIV', 'SICKLE_CELL'], } }, - - - - // Fields we need but I'm unsure how to add as of yet: - // Org name - string - // Limitations of consent - Use some kind of enum? - include all option - // Address change authorization - boolean - - - // Does this file need all fields in the PDF, just those we need to - // process the form, or those actually present in the front end form - // experience? - - - - - - - - - - - - - - - - - - - }, - required: ['veteranFullName', 'veteranSocialSecurityNumber', 'veteranDateOfBirth', 'veteranMailingAddress', 'veteranPhone'], + required: [ + 'veteran', + 'representative', + 'recordConsent', + 'consentAddressChange', + 'consentLimits', + ], }; export default schema; From 481f455fcac06efbc0ed9dcc8c0c95b7614786ac Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Tue, 5 Nov 2024 16:32:02 -0600 Subject: [PATCH 06/12] Update 2122 title --- src/schemas/21-22/schema.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/21-22/schema.js b/src/schemas/21-22/schema.js index 1feb8337..da248faf 100644 --- a/src/schemas/21-22/schema.js +++ b/src/schemas/21-22/schema.js @@ -4,7 +4,7 @@ import definitions from '../../common/definitions'; const schema = { $schema: 'http://json-schema.org/draft-04/schema#', - title: 'APPLICATION FOR APPOINTING AN ACCREDITED REPRESENTATIVE', + title: "APPOINTMENT OF VETERANS SERVICE ORGANIZATION AS CLAIMANT'S REPRESENTATIVE", type: 'object', properties: { // Section I Veteran's Information From 50d8c80f8be5ae534f9a4a2a889b74b4b0f9ec3b Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Tue, 5 Nov 2024 17:21:01 -0600 Subject: [PATCH 07/12] Update 2122a --- src/schemas/21-22A/schema.js | 120 +++++++++++++++++++++-------------- 1 file changed, 71 insertions(+), 49 deletions(-) diff --git a/src/schemas/21-22A/schema.js b/src/schemas/21-22A/schema.js index 69e900e4..ef0c9ddb 100644 --- a/src/schemas/21-22A/schema.js +++ b/src/schemas/21-22A/schema.js @@ -4,62 +4,84 @@ import definitions from '../../common/definitions'; const schema = { $schema: 'http://json-schema.org/draft-04/schema#', - title: 'APPLICATION FOR APPOINTING AN ACCREDITED REPRESENTATIVE', - definitions: { - date: { - format: 'date', - type: 'string', - }, - }, + title: "APPOINTMENT OF INDIVIDUAL AS CLAIMANT'S REPRESENTATIVE", type: 'object', properties: { - attachments: (() => { - const attachments = _.cloneDeep(definitions.files); - attachments.items.properties.dd214 = { type: 'boolean' }; - return attachments; - })(), - veteranFullName: definitions.hcaFullName, - veteranSocialSecurityNumber: definitions.ssn, - veteranVaFileNumber: definitions.vaFileNumber, - veteranDateOfBirth: { - $ref: '#/definitions/date', + // Section I VETERAN'S IDENTIFICATION INFORMATION + veteran: { + type: 'object', + properties: { + name: definitions.hcaFullName, + ssn: definitions.ssn, + vaFileNumber: definitions.vaFileNumber, + dateOfBirth: definitions.date, + serviceNumber: definitions.veteranServiceNumber, + serviceBranch: { + type: 'string', + enum: ['ARMY', 'NAVY', 'AIR_FORCE', 'MARINE_CORPS', 'COAST_GUARD', 'SPACE_FORCE', 'NOAA', 'USPHS'] + }, + address: definitions.hcaAddress, + phone: definitions.hcaPhone, + email: definitions.hcaEmail, + }, + required: [ + 'name', + 'ssn', + 'dateOfBirth', + 'address', + 'phone' + ], }, - veteranServiceNumber: definitions.veteranServiceNumber, - veteranServiceBranch: { - type: 'string', + // Section II Claimant's Information + claimant: { + type: 'object', + properties: { + name: definitions.hcaFullName, + dateOfBirth: definitions.date, + relationship: definitions.relationship, + address: definitions.hcaAddress, + phone: definitions.hcaPhone, + email: definitions.hcaEmail, + }, + // If these are required here but the claimant object isn't required at + // the top level, will that match our use case? Our use case being that + // the claimant object isn't required but if it is present, these fields + // are required. + required: [ + 'name', + 'dateOfBirth', + 'relationship', + 'address', + 'phone' + ], }, - veteranMailingAddress: definitions.hcaAddress, - veteranPhone: definitions.hcaPhone, - veteranEmail: definitions.hcaEmail, + // Section III APPOINTED REPRESENTATIVE'S INFORMATION + representative: { + type: 'object', + properties: { + id: { type: 'string' }, - claimantFullName: definitions.hcaFullName, - claimantDateOfBirth: { - $ref: '#/definitions/date', + }, + required: ['id'], + }, + // Section IV Authorization Information + recordConsent: { type: 'boolean' }, + consentAddressChange: { type: 'boolean' }, + consentLimits: { + type: 'array', + items: { + type: 'string', + enum: ['ALCOHOLISM', 'DRUG_ABUSE', 'HIV', 'SICKLE_CELL'], + } }, - claimantRelationship: definitions.relationship, - claimantMailingAddress: definitions.hcaAddress, - claimantPhone: definitions.hcaPhone, - claimantEmail: definitions.hcaEmail, - - representativeFullName: definitions.hcaFullName, - // representativeIndividualType - representativeMailingAddress: definitions.hcaAddress, - representativePhone: definitions.hcaPhone, - representativeEmail: definitions.hcaEmail, - - // Fields we need but I'm unsure how to add as of yet: - // Org name - string - // Limitations of consent - Use some kind of enum? - include all option - // Address change authorization - boolean - - - // Does this file need all fields in the PDF, just those we need to - // process the form, or those actually present in the front end form - // experience? - - }, - required: ['veteranFullName', 'veteranSocialSecurityNumber', 'veteranDateOfBirth', 'gender', 'veteranAddress'], + required: [ + 'veteran', + 'representative', + 'recordConsent', + 'consentAddressChange', + 'consentLimits', + ], }; export default schema; From 9777cd96f66d93cbb4e0073f522a842a81296369 Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Wed, 6 Nov 2024 11:41:00 -0600 Subject: [PATCH 08/12] Start custom address object --- src/schemas/21-22A/schema.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/schemas/21-22A/schema.js b/src/schemas/21-22A/schema.js index ef0c9ddb..c14b4c08 100644 --- a/src/schemas/21-22A/schema.js +++ b/src/schemas/21-22A/schema.js @@ -2,6 +2,19 @@ import _ from 'lodash'; import constants from '../../common/constants'; import definitions from '../../common/definitions'; +const address = { + type: 'object', + properties: { + addressLine1: { type: 'string', minLength: 1, maxLength: 30 }, + addressLine2: { type: 'string', minLength: 1, maxLength: 5 }, + city: { type: 'string', minLength: 1, maxLength: 18 }, + state_code: { type: 'string', minLength: 2, maxLength: 2 }, + country: { type: 'string' }, + zip_code: { type: 'string' }, + zip_code_suffix: { type: 'string' }, + }, +}; + const schema = { $schema: 'http://json-schema.org/draft-04/schema#', title: "APPOINTMENT OF INDIVIDUAL AS CLAIMANT'S REPRESENTATIVE", @@ -67,12 +80,12 @@ const schema = { // Section IV Authorization Information recordConsent: { type: 'boolean' }, consentAddressChange: { type: 'boolean' }, - consentLimits: { + consentLimits: { type: 'array', - items: { + items: { type: 'string', enum: ['ALCOHOLISM', 'DRUG_ABUSE', 'HIV', 'SICKLE_CELL'], - } + } }, }, required: [ From f078ee9ada6793e108d61101e1b2755ddbb5c7cf Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Wed, 6 Nov 2024 13:40:45 -0600 Subject: [PATCH 09/12] Finish custom address and name objects --- src/schemas/21-22A/schema.js | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/schemas/21-22A/schema.js b/src/schemas/21-22A/schema.js index c14b4c08..f2943496 100644 --- a/src/schemas/21-22A/schema.js +++ b/src/schemas/21-22A/schema.js @@ -9,10 +9,21 @@ const address = { addressLine2: { type: 'string', minLength: 1, maxLength: 5 }, city: { type: 'string', minLength: 1, maxLength: 18 }, state_code: { type: 'string', minLength: 2, maxLength: 2 }, - country: { type: 'string' }, - zip_code: { type: 'string' }, - zip_code_suffix: { type: 'string' }, + country: { type: 'string', minLength: 3, maxLength: 3 }, + zip_code: { type: 'string', "pattern": "^\\d{5}$" }, + zip_code_suffix: { type: 'string', "pattern": "^\\d{4}$" }, }, + required: ['addressLine1', 'city', 'state_code', 'country', 'zip_code'], +}; + +const name = { + type: 'object', + properties: { + first: { type: 'string', minLength: 1, maxLength: 12 }, + middle: { type: 'string', minLength: 1, maxLength: 1 }, + last: { type: 'string', minLength: 1, maxLength: 18 }, + }, + required: ['first', 'last'], }; const schema = { @@ -24,7 +35,7 @@ const schema = { veteran: { type: 'object', properties: { - name: definitions.hcaFullName, + name: name, ssn: definitions.ssn, vaFileNumber: definitions.vaFileNumber, dateOfBirth: definitions.date, @@ -33,7 +44,7 @@ const schema = { type: 'string', enum: ['ARMY', 'NAVY', 'AIR_FORCE', 'MARINE_CORPS', 'COAST_GUARD', 'SPACE_FORCE', 'NOAA', 'USPHS'] }, - address: definitions.hcaAddress, + address: address, phone: definitions.hcaPhone, email: definitions.hcaEmail, }, @@ -49,10 +60,10 @@ const schema = { claimant: { type: 'object', properties: { - name: definitions.hcaFullName, + name: name, dateOfBirth: definitions.date, relationship: definitions.relationship, - address: definitions.hcaAddress, + address: address, phone: definitions.hcaPhone, email: definitions.hcaEmail, }, From fbf2055d498fe0efc274d7443f138daa066f3264 Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Wed, 6 Nov 2024 13:45:08 -0600 Subject: [PATCH 10/12] Use custom objects across both schemas --- src/schemas/21-22/schema.js | 9 +++++---- src/schemas/21-22A/schema.js | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/schemas/21-22/schema.js b/src/schemas/21-22/schema.js index da248faf..18b1908c 100644 --- a/src/schemas/21-22/schema.js +++ b/src/schemas/21-22/schema.js @@ -1,6 +1,7 @@ import _ from 'lodash'; import constants from '../../common/constants'; import definitions from '../../common/definitions'; +import { address, name } from '../21-22A/schema'; const schema = { $schema: 'http://json-schema.org/draft-04/schema#', @@ -11,12 +12,12 @@ const schema = { veteran: { type: 'object', properties: { - name: definitions.hcaFullName, + name: name, ssn: definitions.ssn, vaFileNumber: definitions.vaFileNumber, dateOfBirth: definitions.date, serviceNumber: definitions.veteranServiceNumber, - address: definitions.hcaAddress, + address: address, phone: definitions.hcaPhone, email: definitions.hcaEmail, }, @@ -32,10 +33,10 @@ const schema = { claimant: { type: 'object', properties: { - name: definitions.hcaFullName, + name: name, dateOfBirth: definitions.date, relationship: definitions.relationship, - address: definitions.hcaAddress, + address: address, phone: definitions.hcaPhone, email: definitions.hcaEmail, }, diff --git a/src/schemas/21-22A/schema.js b/src/schemas/21-22A/schema.js index f2943496..b8037d1a 100644 --- a/src/schemas/21-22A/schema.js +++ b/src/schemas/21-22A/schema.js @@ -108,4 +108,4 @@ const schema = { ], }; -export default schema; +export default {schema, address, name}; From c5ccb1198c3ef5e87497b05a23c127d1846e8208 Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Wed, 6 Nov 2024 13:54:52 -0600 Subject: [PATCH 11/12] Try different export --- src/schemas/21-22A/schema.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/schemas/21-22A/schema.js b/src/schemas/21-22A/schema.js index b8037d1a..6400a0ff 100644 --- a/src/schemas/21-22A/schema.js +++ b/src/schemas/21-22A/schema.js @@ -2,7 +2,7 @@ import _ from 'lodash'; import constants from '../../common/constants'; import definitions from '../../common/definitions'; -const address = { +export const address = { type: 'object', properties: { addressLine1: { type: 'string', minLength: 1, maxLength: 30 }, @@ -16,7 +16,7 @@ const address = { required: ['addressLine1', 'city', 'state_code', 'country', 'zip_code'], }; -const name = { +export const name = { type: 'object', properties: { first: { type: 'string', minLength: 1, maxLength: 12 }, @@ -108,4 +108,4 @@ const schema = { ], }; -export default {schema, address, name}; +export default schema; From ef9ad699e7b177b54d749c6fdc42f185cc1a9cb8 Mon Sep 17 00:00:00 2001 From: Josh Fike Date: Wed, 6 Nov 2024 14:14:22 -0600 Subject: [PATCH 12/12] Update package.json and dist --- dist/21-22-schema.json | 671 +++++++++++---------------------------- dist/21-22A-schema.json | 676 +++++++++++----------------------------- package.json | 2 +- 3 files changed, 366 insertions(+), 983 deletions(-) diff --git a/dist/21-22-schema.json b/dist/21-22-schema.json index 640c2e38..0e472329 100644 --- a/dist/21-22-schema.json +++ b/dist/21-22-schema.json @@ -1,563 +1,248 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "APPLICATION FOR APPOINTING AN ACCREDITED REPRESENTATIVE", - "definitions": { - "date": { - "format": "date", - "type": "string" - } - }, + "title": "APPOINTMENT OF VETERANS SERVICE ORGANIZATION AS CLAIMANT'S REPRESENTATIVE", "type": "object", "properties": { - "attachments": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "size": { - "type": "integer" - }, - "confirmationCode": { - "type": "string" - }, - "dd214": { - "type": "boolean" - } - } - } - }, - "veteranFullName": { + "veteran": { "type": "object", "properties": { - "first": { - "type": "string", - "minLength": 1, - "maxLength": 25, - "pattern": "^.*\\S.*" + "name": { + "type": "object", + "properties": { + "first": { + "type": "string", + "minLength": 1, + "maxLength": 12 + }, + "middle": { + "type": "string", + "minLength": 1, + "maxLength": 1 + }, + "last": { + "type": "string", + "minLength": 1, + "maxLength": 18 + } + }, + "required": [ + "first", + "last" + ] }, - "middle": { + "ssn": { "type": "string", - "maxLength": 30 + "pattern": "^[0-9]{9}$" }, - "last": { + "vaFileNumber": { "type": "string", - "minLength": 2, - "maxLength": 35, - "pattern": "^.*\\S.*" + "pattern": "^[cC]{0,1}\\d{7,9}$" + }, + "dateOfBirth": { + "pattern": "^(\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$", + "type": "string" }, - "suffix": { + "serviceNumber": { "type": "string", - "enum": [ - "Jr.", - "Sr.", - "II", - "III", - "IV" - ] - } - }, - "required": [ - "first", - "last" - ] - }, - "veteranSocialSecurityNumber": { - "type": "string", - "pattern": "^[0-9]{9}$" - }, - "gender": { - "type": "string", - "enum": [ - "F", - "M" - ] - }, - "veteranDateOfBirth": { - "$ref": "#/definitions/date" - }, - "maritalStatus": { - "type": "string", - "enum": [ - "Married", - "Never Married", - "Separated", - "Widowed", - "Divorced" - ] - }, - "veteranAddress": { - "type": "object", - "oneOf": [ - { + "pattern": "^[A-Z]{0,2}\\d{5,8}$" + }, + "address": { + "type": "object", "properties": { - "country": { + "addressLine1": { "type": "string", - "enum": [ - "CAN" - ] + "minLength": 1, + "maxLength": 30 }, - "state": { + "addressLine2": { "type": "string", - "enum": [ - "AB", - "BC", - "MB", - "NB", - "NL", - "NT", - "NS", - "NU", - "ON", - "PE", - "QC", - "SK", - "YT" - ] - } - } - }, - { - "properties": { - "country": { + "minLength": 1, + "maxLength": 5 + }, + "city": { "type": "string", - "enum": [ - "MEX" - ] + "minLength": 1, + "maxLength": 18 }, - "state": { + "state_code": { "type": "string", - "enum": [ - "aguascalientes", - "baja-california-norte", - "baja-california-sur", - "campeche", - "chiapas", - "chihuahua", - "coahuila", - "colima", - "distrito-federal", - "durango", - "guanajuato", - "guerrero", - "hidalgo", - "jalisco", - "mexico", - "michoacan", - "morelos", - "nayarit", - "nuevo-leon", - "oaxaca", - "puebla", - "queretaro", - "quintana-roo", - "san-luis-potosi", - "sinaloa", - "sonora", - "tabasco", - "tamaulipas", - "tlaxcala", - "veracruz", - "yucatan", - "zacatecas" - ] - } - } - }, - { - "properties": { + "minLength": 2, + "maxLength": 2 + }, "country": { "type": "string", - "enum": [ - "USA" - ] + "minLength": 3, + "maxLength": 3 }, - "state": { + "zip_code": { "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" - ] - } - } - }, - { - "properties": { - "country": { - "not": { - "type": "string", - "enum": [ - "CAN", - "MEX", - "USA" - ] - } + "pattern": "^\\d{5}$" }, - "provinceCode": { + "zip_code_suffix": { "type": "string", - "maxLength": 51, - "pattern": "^.*\\S.*" + "pattern": "^\\d{4}$" } - } - } - ], - "properties": { - "street": { - "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^.*\\S.*" - }, - "street2": { - "type": "string", - "maxLength": 30 - }, - "street3": { - "type": "string", - "maxLength": 30 + }, + "required": [ + "addressLine1", + "city", + "state_code", + "country", + "zip_code" + ] }, - "city": { + "phone": { "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^.*\\S.*" + "pattern": "^[0-9]{10}$" }, - "postalCode": { + "email": { "type": "string", - "maxLength": 51, - "pattern": "^.*\\S.*" + "pattern": "^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$" } }, "required": [ - "street", - "city", - "country" + "name", + "ssn", + "dateOfBirth", + "address", + "phone" ] }, - "veteranHomeAddress": { + "claimant": { "type": "object", - "oneOf": [ - { + "properties": { + "name": { + "type": "object", "properties": { - "country": { + "first": { + "type": "string", + "minLength": 1, + "maxLength": 12 + }, + "middle": { "type": "string", - "enum": [ - "CAN" - ] + "minLength": 1, + "maxLength": 1 }, - "state": { + "last": { "type": "string", - "enum": [ - "AB", - "BC", - "MB", - "NB", - "NL", - "NT", - "NS", - "NU", - "ON", - "PE", - "QC", - "SK", - "YT" - ] + "minLength": 1, + "maxLength": 18 } - } + }, + "required": [ + "first", + "last" + ] + }, + "dateOfBirth": { + "pattern": "^(\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$", + "type": "string" }, - { + "relationship": { + "type": "string", + "enum": [ + "spouse", + "child" + ] + }, + "address": { + "type": "object", "properties": { - "country": { + "addressLine1": { "type": "string", - "enum": [ - "MEX" - ] + "minLength": 1, + "maxLength": 30 }, - "state": { + "addressLine2": { "type": "string", - "enum": [ - "aguascalientes", - "baja-california-norte", - "baja-california-sur", - "campeche", - "chiapas", - "chihuahua", - "coahuila", - "colima", - "distrito-federal", - "durango", - "guanajuato", - "guerrero", - "hidalgo", - "jalisco", - "mexico", - "michoacan", - "morelos", - "nayarit", - "nuevo-leon", - "oaxaca", - "puebla", - "queretaro", - "quintana-roo", - "san-luis-potosi", - "sinaloa", - "sonora", - "tabasco", - "tamaulipas", - "tlaxcala", - "veracruz", - "yucatan", - "zacatecas" - ] - } - } - }, - { - "properties": { - "country": { + "minLength": 1, + "maxLength": 5 + }, + "city": { "type": "string", - "enum": [ - "USA" - ] + "minLength": 1, + "maxLength": 18 }, - "state": { + "state_code": { "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" - ] - } - } - }, - { - "properties": { + "minLength": 2, + "maxLength": 2 + }, "country": { - "not": { - "type": "string", - "enum": [ - "CAN", - "MEX", - "USA" - ] - } + "type": "string", + "minLength": 3, + "maxLength": 3 + }, + "zip_code": { + "type": "string", + "pattern": "^\\d{5}$" }, - "provinceCode": { + "zip_code_suffix": { "type": "string", - "maxLength": 51, - "pattern": "^.*\\S.*" + "pattern": "^\\d{4}$" } - } - } - ], - "properties": { - "street": { - "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^.*\\S.*" - }, - "street2": { - "type": "string", - "maxLength": 30 - }, - "street3": { - "type": "string", - "maxLength": 30 + }, + "required": [ + "addressLine1", + "city", + "state_code", + "country", + "zip_code" + ] }, - "city": { + "phone": { "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^.*\\S.*" + "pattern": "^[0-9]{10}$" }, - "postalCode": { + "email": { "type": "string", - "maxLength": 51, - "pattern": "^.*\\S.*" + "pattern": "^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$" } }, "required": [ - "street", - "city", - "country" + "name", + "dateOfBirth", + "relationship", + "address", + "phone" ] }, - "email": { - "type": "string", - "pattern": "^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$" - }, - "homePhone": { - "type": "string", - "pattern": "^[0-9]{10}$" - }, - "mobilePhone": { - "type": "string", - "pattern": "^[0-9]{10}$" - }, - "lastServiceBranch": { - "type": "string", - "enum": [ - "air force", - "army", - "coast guard", - "marine corps", - "merchant seaman", - "navy", - "noaa", - "space force", - "usphs", - "f.commonwealth", - "f.guerilla", - "f.scouts new", - "f.scouts old", - "other" - ] + "representative": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "organizationId": { + "type": "string" + } + } }, - "lastEntryDate": { - "$ref": "#/definitions/date" + "recordConsent": { + "type": "boolean" }, - "lastDischargeDate": { - "$ref": "#/definitions/date" + "consentAddressChange": { + "type": "boolean" }, - "dischargeType": { - "type": "string", - "enum": [ - "honorable", - "general", - "other", - "bad-conduct", - "dishonorable", - "undesirable" - ] + "consentLimits": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "ALCOHOLISM", + "DRUG_ABUSE", + "HIV", + "SICKLE_CELL" + ] + } } }, "required": [ - "veteranFullName", - "veteranSocialSecurityNumber", - "veteranDateOfBirth", - "gender", - "veteranAddress" + "veteran", + "representative", + "recordConsent", + "consentAddressChange", + "consentLimits" ] } diff --git a/dist/21-22A-schema.json b/dist/21-22A-schema.json index 640c2e38..5825ac57 100644 --- a/dist/21-22A-schema.json +++ b/dist/21-22A-schema.json @@ -1,563 +1,261 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "APPLICATION FOR APPOINTING AN ACCREDITED REPRESENTATIVE", - "definitions": { - "date": { - "format": "date", - "type": "string" - } - }, + "title": "APPOINTMENT OF INDIVIDUAL AS CLAIMANT'S REPRESENTATIVE", "type": "object", "properties": { - "attachments": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "size": { - "type": "integer" - }, - "confirmationCode": { - "type": "string" - }, - "dd214": { - "type": "boolean" - } - } - } - }, - "veteranFullName": { + "veteran": { "type": "object", "properties": { - "first": { + "name": { + "type": "object", + "properties": { + "first": { + "type": "string", + "minLength": 1, + "maxLength": 12 + }, + "middle": { + "type": "string", + "minLength": 1, + "maxLength": 1 + }, + "last": { + "type": "string", + "minLength": 1, + "maxLength": 18 + } + }, + "required": [ + "first", + "last" + ] + }, + "ssn": { "type": "string", - "minLength": 1, - "maxLength": 25, - "pattern": "^.*\\S.*" + "pattern": "^[0-9]{9}$" }, - "middle": { + "vaFileNumber": { "type": "string", - "maxLength": 30 + "pattern": "^[cC]{0,1}\\d{7,9}$" }, - "last": { + "dateOfBirth": { + "pattern": "^(\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$", + "type": "string" + }, + "serviceNumber": { "type": "string", - "minLength": 2, - "maxLength": 35, - "pattern": "^.*\\S.*" + "pattern": "^[A-Z]{0,2}\\d{5,8}$" }, - "suffix": { + "serviceBranch": { "type": "string", "enum": [ - "Jr.", - "Sr.", - "II", - "III", - "IV" + "ARMY", + "NAVY", + "AIR_FORCE", + "MARINE_CORPS", + "COAST_GUARD", + "SPACE_FORCE", + "NOAA", + "USPHS" ] - } - }, - "required": [ - "first", - "last" - ] - }, - "veteranSocialSecurityNumber": { - "type": "string", - "pattern": "^[0-9]{9}$" - }, - "gender": { - "type": "string", - "enum": [ - "F", - "M" - ] - }, - "veteranDateOfBirth": { - "$ref": "#/definitions/date" - }, - "maritalStatus": { - "type": "string", - "enum": [ - "Married", - "Never Married", - "Separated", - "Widowed", - "Divorced" - ] - }, - "veteranAddress": { - "type": "object", - "oneOf": [ - { + }, + "address": { + "type": "object", "properties": { - "country": { + "addressLine1": { "type": "string", - "enum": [ - "CAN" - ] + "minLength": 1, + "maxLength": 30 }, - "state": { + "addressLine2": { "type": "string", - "enum": [ - "AB", - "BC", - "MB", - "NB", - "NL", - "NT", - "NS", - "NU", - "ON", - "PE", - "QC", - "SK", - "YT" - ] - } - } - }, - { - "properties": { - "country": { + "minLength": 1, + "maxLength": 5 + }, + "city": { "type": "string", - "enum": [ - "MEX" - ] + "minLength": 1, + "maxLength": 18 }, - "state": { + "state_code": { "type": "string", - "enum": [ - "aguascalientes", - "baja-california-norte", - "baja-california-sur", - "campeche", - "chiapas", - "chihuahua", - "coahuila", - "colima", - "distrito-federal", - "durango", - "guanajuato", - "guerrero", - "hidalgo", - "jalisco", - "mexico", - "michoacan", - "morelos", - "nayarit", - "nuevo-leon", - "oaxaca", - "puebla", - "queretaro", - "quintana-roo", - "san-luis-potosi", - "sinaloa", - "sonora", - "tabasco", - "tamaulipas", - "tlaxcala", - "veracruz", - "yucatan", - "zacatecas" - ] - } - } - }, - { - "properties": { + "minLength": 2, + "maxLength": 2 + }, "country": { "type": "string", - "enum": [ - "USA" - ] + "minLength": 3, + "maxLength": 3 }, - "state": { + "zip_code": { "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" - ] - } - } - }, - { - "properties": { - "country": { - "not": { - "type": "string", - "enum": [ - "CAN", - "MEX", - "USA" - ] - } + "pattern": "^\\d{5}$" }, - "provinceCode": { + "zip_code_suffix": { "type": "string", - "maxLength": 51, - "pattern": "^.*\\S.*" + "pattern": "^\\d{4}$" } - } - } - ], - "properties": { - "street": { - "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^.*\\S.*" - }, - "street2": { - "type": "string", - "maxLength": 30 - }, - "street3": { - "type": "string", - "maxLength": 30 + }, + "required": [ + "addressLine1", + "city", + "state_code", + "country", + "zip_code" + ] }, - "city": { + "phone": { "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^.*\\S.*" + "pattern": "^[0-9]{10}$" }, - "postalCode": { + "email": { "type": "string", - "maxLength": 51, - "pattern": "^.*\\S.*" + "pattern": "^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$" } }, "required": [ - "street", - "city", - "country" + "name", + "ssn", + "dateOfBirth", + "address", + "phone" ] }, - "veteranHomeAddress": { + "claimant": { "type": "object", - "oneOf": [ - { + "properties": { + "name": { + "type": "object", "properties": { - "country": { + "first": { + "type": "string", + "minLength": 1, + "maxLength": 12 + }, + "middle": { "type": "string", - "enum": [ - "CAN" - ] + "minLength": 1, + "maxLength": 1 }, - "state": { + "last": { "type": "string", - "enum": [ - "AB", - "BC", - "MB", - "NB", - "NL", - "NT", - "NS", - "NU", - "ON", - "PE", - "QC", - "SK", - "YT" - ] + "minLength": 1, + "maxLength": 18 } - } + }, + "required": [ + "first", + "last" + ] + }, + "dateOfBirth": { + "pattern": "^(\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$", + "type": "string" }, - { + "relationship": { + "type": "string", + "enum": [ + "spouse", + "child" + ] + }, + "address": { + "type": "object", "properties": { - "country": { + "addressLine1": { "type": "string", - "enum": [ - "MEX" - ] + "minLength": 1, + "maxLength": 30 }, - "state": { + "addressLine2": { "type": "string", - "enum": [ - "aguascalientes", - "baja-california-norte", - "baja-california-sur", - "campeche", - "chiapas", - "chihuahua", - "coahuila", - "colima", - "distrito-federal", - "durango", - "guanajuato", - "guerrero", - "hidalgo", - "jalisco", - "mexico", - "michoacan", - "morelos", - "nayarit", - "nuevo-leon", - "oaxaca", - "puebla", - "queretaro", - "quintana-roo", - "san-luis-potosi", - "sinaloa", - "sonora", - "tabasco", - "tamaulipas", - "tlaxcala", - "veracruz", - "yucatan", - "zacatecas" - ] - } - } - }, - { - "properties": { - "country": { + "minLength": 1, + "maxLength": 5 + }, + "city": { "type": "string", - "enum": [ - "USA" - ] + "minLength": 1, + "maxLength": 18 }, - "state": { + "state_code": { "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" - ] - } - } - }, - { - "properties": { + "minLength": 2, + "maxLength": 2 + }, "country": { - "not": { - "type": "string", - "enum": [ - "CAN", - "MEX", - "USA" - ] - } + "type": "string", + "minLength": 3, + "maxLength": 3 + }, + "zip_code": { + "type": "string", + "pattern": "^\\d{5}$" }, - "provinceCode": { + "zip_code_suffix": { "type": "string", - "maxLength": 51, - "pattern": "^.*\\S.*" + "pattern": "^\\d{4}$" } - } - } - ], - "properties": { - "street": { - "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^.*\\S.*" - }, - "street2": { - "type": "string", - "maxLength": 30 - }, - "street3": { - "type": "string", - "maxLength": 30 + }, + "required": [ + "addressLine1", + "city", + "state_code", + "country", + "zip_code" + ] }, - "city": { + "phone": { "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^.*\\S.*" + "pattern": "^[0-9]{10}$" }, - "postalCode": { + "email": { "type": "string", - "maxLength": 51, - "pattern": "^.*\\S.*" + "pattern": "^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$" } }, "required": [ - "street", - "city", - "country" + "name", + "dateOfBirth", + "relationship", + "address", + "phone" ] }, - "email": { - "type": "string", - "pattern": "^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$" - }, - "homePhone": { - "type": "string", - "pattern": "^[0-9]{10}$" - }, - "mobilePhone": { - "type": "string", - "pattern": "^[0-9]{10}$" - }, - "lastServiceBranch": { - "type": "string", - "enum": [ - "air force", - "army", - "coast guard", - "marine corps", - "merchant seaman", - "navy", - "noaa", - "space force", - "usphs", - "f.commonwealth", - "f.guerilla", - "f.scouts new", - "f.scouts old", - "other" + "representative": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" ] }, - "lastEntryDate": { - "$ref": "#/definitions/date" + "recordConsent": { + "type": "boolean" }, - "lastDischargeDate": { - "$ref": "#/definitions/date" + "consentAddressChange": { + "type": "boolean" }, - "dischargeType": { - "type": "string", - "enum": [ - "honorable", - "general", - "other", - "bad-conduct", - "dishonorable", - "undesirable" - ] + "consentLimits": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "ALCOHOLISM", + "DRUG_ABUSE", + "HIV", + "SICKLE_CELL" + ] + } } }, "required": [ - "veteranFullName", - "veteranSocialSecurityNumber", - "veteranDateOfBirth", - "gender", - "veteranAddress" + "veteran", + "representative", + "recordConsent", + "consentAddressChange", + "consentLimits" ] } diff --git a/package.json b/package.json index cb18405a..e03ab197 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vets-json-schema", - "version": "24.5.2", + "version": "24.5.4", "license": "CC0-1.0", "repository": { "type": "git",