diff --git a/dist/21-22-schema.json b/dist/21-22-schema.json index 640c2e382..0e472329e 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 640c2e382..5825ac57f 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/dist/40-10007-INTEGRATION-schema.json b/dist/40-10007-INTEGRATION-schema.json index 25f0c8cb9..06a92b215 100644 --- a/dist/40-10007-INTEGRATION-schema.json +++ b/dist/40-10007-INTEGRATION-schema.json @@ -291,7 +291,7 @@ }, "ssn": { "type": "string", - "pattern": "^\\d{3}-\\d{2}-\\d{4}$" + "pattern": "^\\d{3}\\d{2}\\d{4}$" }, "centralMailVaFile": { "type": "string", diff --git a/dist/40-10007-schema.json b/dist/40-10007-schema.json index ae27df53c..2b11f181c 100644 --- a/dist/40-10007-schema.json +++ b/dist/40-10007-schema.json @@ -291,7 +291,7 @@ }, "ssn": { "type": "string", - "pattern": "^\\d{3}-\\d{2}-\\d{4}$" + "pattern": "^\\d{3}\\d{2}\\d{4}$" }, "centralMailVaFile": { "type": "string", diff --git a/dist/FEEDBACK-TOOL-schema.json b/dist/FEEDBACK-TOOL-schema.json index 9365d9d07..b5d3f02c4 100644 --- a/dist/FEEDBACK-TOOL-schema.json +++ b/dist/FEEDBACK-TOOL-schema.json @@ -895,31 +895,31 @@ "issue": { "type": "object", "properties": { - "other": { + "recruiting": { "type": "boolean", "default": false }, - "recruiting": { + "accreditation": { "type": "boolean", "default": false }, - "studentLoans": { + "financialIssues": { "type": "boolean", "default": false }, - "quality": { + "studentLoans": { "type": "boolean", "default": false }, - "creditTransfer": { + "jobOpportunities": { "type": "boolean", "default": false }, - "accreditation": { + "changeInDegree": { "type": "boolean", "default": false }, - "jobOpportunities": { + "quality": { "type": "boolean", "default": false }, @@ -927,19 +927,19 @@ "type": "boolean", "default": false }, - "refundIssues": { + "transcriptRelease": { "type": "boolean", "default": false }, - "financialIssues": { + "creditTransfer": { "type": "boolean", "default": false }, - "changeInDegree": { + "refundIssues": { "type": "boolean", "default": false }, - "transcriptRelease": { + "other": { "type": "boolean", "default": false } diff --git a/package.json b/package.json index 833bc704e..f51ad97ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vets-json-schema", - "version": "24.5.3", + "version": "24.5.5", "license": "CC0-1.0", "repository": { "type": "git", diff --git a/src/schemas/21-22/schema.js b/src/schemas/21-22/schema.js index a8c150be9..18b1908c4 100644 --- a/src/schemas/21-22/schema.js +++ b/src/schemas/21-22/schema.js @@ -1,52 +1,84 @@ 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#', - 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: (() => { - const attachments = _.cloneDeep(definitions.files); - attachments.items.properties.dd214 = { type: 'boolean' }; - return attachments; - })(), - veteranFullName: definitions.hcaFullName, - veteranSocialSecurityNumber: definitions.ssn, - gender: { - type: 'string', - enum: constants.genders.map(option => option.value), + // Section I Veteran's Information + veteran: { + type: 'object', + properties: { + name: name, + ssn: definitions.ssn, + vaFileNumber: definitions.vaFileNumber, + dateOfBirth: definitions.date, + serviceNumber: definitions.veteranServiceNumber, + address: address, + phone: definitions.hcaPhone, + email: definitions.hcaEmail, + }, + required: [ + 'name', + 'ssn', + 'dateOfBirth', + 'address', + 'phone' + ], }, - veteranDateOfBirth: { - $ref: '#/definitions/date', + // Section II Claimant's Information + claimant: { + type: 'object', + properties: { + name: name, + dateOfBirth: definitions.date, + relationship: definitions.relationship, + address: address, + 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' + ], }, - maritalStatus: definitions.maritalStatus, - veteranAddress: definitions.hcaAddress, - veteranHomeAddress: definitions.hcaAddress, - email: definitions.hcaEmail, - homePhone: definitions.hcaPhone, - mobilePhone: definitions.hcaPhone, + // Section III Service Organization Information + representative: { + type: 'object', + properties: { + id: { type: 'string' }, + organizationId: { type: 'string' }, - lastServiceBranch: { - type: 'string', - enum: constants.branchesServed.map(option => option.value), - }, - lastEntryDate: { - $ref: '#/definitions/date', + }, }, - lastDischargeDate: { - $ref: '#/definitions/date', + // Section IV Authorization Information + recordConsent: { type: 'boolean' }, + consentAddressChange: { type: 'boolean' }, + consentLimits: { + type: 'array', + items: { + type: 'string', + enum: ['ALCOHOLISM', 'DRUG_ABUSE', 'HIV', 'SICKLE_CELL'], + } }, - dischargeType: definitions.dischargeType, }, - required: ['veteranFullName', 'veteranSocialSecurityNumber', 'veteranDateOfBirth', 'gender', 'veteranAddress'], + required: [ + 'veteran', + 'representative', + 'recordConsent', + 'consentAddressChange', + 'consentLimits', + ], }; export default schema; diff --git a/src/schemas/21-22A/schema.js b/src/schemas/21-22A/schema.js index a8c150be9..6400a0ffe 100644 --- a/src/schemas/21-22A/schema.js +++ b/src/schemas/21-22A/schema.js @@ -2,51 +2,110 @@ import _ from 'lodash'; import constants from '../../common/constants'; import definitions from '../../common/definitions'; +export 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', 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'], +}; + +export 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 = { $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, - gender: { - type: 'string', - enum: constants.genders.map(option => option.value), + // Section I VETERAN'S IDENTIFICATION INFORMATION + veteran: { + type: 'object', + properties: { + name: name, + 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: address, + phone: definitions.hcaPhone, + email: definitions.hcaEmail, + }, + required: [ + 'name', + 'ssn', + 'dateOfBirth', + 'address', + 'phone' + ], }, - veteranDateOfBirth: { - $ref: '#/definitions/date', + // Section II Claimant's Information + claimant: { + type: 'object', + properties: { + name: name, + dateOfBirth: definitions.date, + relationship: definitions.relationship, + address: address, + 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' + ], }, - maritalStatus: definitions.maritalStatus, - veteranAddress: definitions.hcaAddress, - veteranHomeAddress: definitions.hcaAddress, - email: definitions.hcaEmail, - homePhone: definitions.hcaPhone, - mobilePhone: definitions.hcaPhone, + // Section III APPOINTED REPRESENTATIVE'S INFORMATION + representative: { + type: 'object', + properties: { + id: { type: 'string' }, - lastServiceBranch: { - type: 'string', - enum: constants.branchesServed.map(option => option.value), - }, - lastEntryDate: { - $ref: '#/definitions/date', + }, + required: ['id'], }, - lastDischargeDate: { - $ref: '#/definitions/date', + // Section IV Authorization Information + recordConsent: { type: 'boolean' }, + consentAddressChange: { type: 'boolean' }, + consentLimits: { + type: 'array', + items: { + type: 'string', + enum: ['ALCOHOLISM', 'DRUG_ABUSE', 'HIV', 'SICKLE_CELL'], + } }, - dischargeType: definitions.dischargeType, }, - required: ['veteranFullName', 'veteranSocialSecurityNumber', 'veteranDateOfBirth', 'gender', 'veteranAddress'], + required: [ + 'veteran', + 'representative', + 'recordConsent', + 'consentAddressChange', + 'consentLimits', + ], }; export default schema; diff --git a/src/schemas/22-10282/schema.js b/src/schemas/22-10282/schema.js index cfc2368e2..29e06adf7 100644 --- a/src/schemas/22-10282/schema.js +++ b/src/schemas/22-10282/schema.js @@ -8,7 +8,8 @@ const { salesforceCountries: countries } = constants; definitions.country = { type: 'string', - enum: countries.map(country => country.label), + enum: ['United States', ...countries.filter(country => country.value !== 'USA').map(country => country.label)], + default: 'United States' }; definitions.state = { type: 'string', diff --git a/src/schemas/40-10007-integration/schema.js b/src/schemas/40-10007-integration/schema.js index 5a71ec6e8..16d03f6c9 100644 --- a/src/schemas/40-10007-integration/schema.js +++ b/src/schemas/40-10007-integration/schema.js @@ -186,7 +186,7 @@ definitions.phone.minLength = 10; definitions.phone.maxLength = 20; definitions.phone.pattern = '^(?:\\D*\\d){10,15}\\D*$'; -definitions.ssn.pattern = '^\\d{3}-\\d{2}-\\d{4}$'; +definitions.ssn.pattern = '^\\d{3}\\d{2}\\d{4}$'; definitions.ethnicity = { type: 'string', diff --git a/src/schemas/40-10007/schema.js b/src/schemas/40-10007/schema.js index c1859e22a..fb9c56e98 100644 --- a/src/schemas/40-10007/schema.js +++ b/src/schemas/40-10007/schema.js @@ -185,7 +185,7 @@ definitions.phone.minLength = 10; definitions.phone.maxLength = 20; definitions.phone.pattern = '^(?:\\D*\\d){10,15}\\D*$'; -definitions.ssn.pattern = '^\\d{3}-\\d{2}-\\d{4}$'; +definitions.ssn.pattern = '^\\d{3}\\d{2}\\d{4}$'; definitions.race = { type: 'object', diff --git a/src/schemas/FEEDBACK-TOOL/schema.js b/src/schemas/FEEDBACK-TOOL/schema.js index f3a512b3f..09b396dc7 100644 --- a/src/schemas/FEEDBACK-TOOL/schema.js +++ b/src/schemas/FEEDBACK-TOOL/schema.js @@ -317,31 +317,31 @@ const schema = { type: 'object', // FE validation requires at least one selected properties: { // TODO: obtain updated options based on sample request - other: { + recruiting: { type: 'boolean', default: false, }, - recruiting: { + accreditation: { type: 'boolean', default: false, }, - studentLoans: { + financialIssues: { type: 'boolean', default: false, }, - quality: { + studentLoans: { type: 'boolean', default: false, }, - creditTransfer: { + jobOpportunities: { type: 'boolean', default: false, }, - accreditation: { + changeInDegree: { type: 'boolean', default: false, }, - jobOpportunities: { + quality: { type: 'boolean', default: false, }, @@ -349,19 +349,19 @@ const schema = { type: 'boolean', default: false, }, - refundIssues: { + transcriptRelease: { type: 'boolean', default: false, }, - financialIssues: { + creditTransfer: { type: 'boolean', default: false, }, - changeInDegree: { + refundIssues: { type: 'boolean', default: false, }, - transcriptRelease: { + other: { type: 'boolean', default: false, }, diff --git a/test/schemas/40-10007/schema.spec.js b/test/schemas/40-10007/schema.spec.js index ae48dfc49..e86f758e4 100644 --- a/test/schemas/40-10007/schema.spec.js +++ b/test/schemas/40-10007/schema.spec.js @@ -29,7 +29,7 @@ describe('preneeds schema', () => { }); schemaTestHelper.testValidAndInvalid('application.claimant.ssn', { - valid: ['000-12-3456'], + valid: ['000123456'], invalid: ['bad'], });