Skip to content

Commit

Permalink
API-38827-update-validations-intl-postal-code (#18323)
Browse files Browse the repository at this point in the history
* Makes changes to the 526 v2 schema for internationalPostalCode, Adjusts doc/swagger files. Removes requirement validation for internationalPostalCode.

* Updates schema & docs

* Updates regex to exclude hypens, and updates swagger files for v2 dev and prod
  • Loading branch information
stiehlrod committed Sep 9, 2024
1 parent 8a60715 commit 430a1e3
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ def validate_form_526_change_of_address_zip
source: '/changeOfAddress/zipFirstFive',
detail: 'The zipFirstFive is required if the country is USA.'
)
elsif address['country'] != 'USA' && address['internationalPostalCode'].blank?
collect_error_messages(
source: '/changeOfAddress/internationalPostalCode',
detail: 'The internationalPostalCode is required if the country is not USA.'
)
elsif address['country'] == 'USA' && address['internationalPostalCode'].present?
collect_error_messages(
source: '/changeOfAddress/internationalPostalCode',
Expand Down Expand Up @@ -198,11 +193,6 @@ def validate_form_526_current_mailing_address_zip
source: '/veteranIdentification/mailingAddress/zipFirstFive',
detail: 'The zipFirstFive is required if the country is USA.'
)
elsif mailing_address['country'] != 'USA' && mailing_address['internationalPostalCode'].blank?
collect_error_messages(
source: '/veteranIdentification/mailingAddress/internationalPostalCode',
detail: 'The internationalPostalCode is required if the country is not USA.'
)
elsif mailing_address['country'] == 'USA' && mailing_address['internationalPostalCode'].present?
collect_error_messages(
source: '/veteranIdentification/mailingAddress/internationalPostalCode',
Expand Down
90 changes: 50 additions & 40 deletions modules/claims_api/app/swagger/claims_api/v2/dev/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2143,10 +2143,11 @@
"nullable": true
},
"internationalPostalCode": {
"description": "International postal code for the Veteran's current mailing address. Required if 'country' is not 'USA'. Do not include if 'country' is 'USA'.",
"description": "International postal code for the Veteran's current mailing address. Do not include if 'country' is 'USA'.",
"type": "string",
"maxLength": 100,
"nullable": true
"maxLength": 16,
"nullable": true,
"pattern": "^[a-zA-Z0-9]*$"
}
}
},
Expand Down Expand Up @@ -2252,10 +2253,11 @@
"example": "6789"
},
"internationalPostalCode": {
"description": "International postal code for the Veteran's new address. Requried if 'country' is not 'USA'. Do not include if 'country' is 'USA'.",
"description": "International postal code for the Veteran's new address. Do not include if 'country' is 'USA'.",
"type": "string",
"maxLength": 100,
"nullable": true
"maxLength": 16,
"nullable": true,
"pattern": "^[a-zA-Z0-9]*$"
},
"dates": {
"type": "object",
Expand Down Expand Up @@ -3523,10 +3525,11 @@
"nullable": true
},
"internationalPostalCode": {
"description": "International postal code for the Veteran's current mailing address. Required if 'country' is not 'USA'. Do not include if 'country' is 'USA'.",
"description": "International postal code for the Veteran's current mailing address. Do not include if 'country' is 'USA'.",
"type": "string",
"maxLength": 100,
"nullable": true
"maxLength": 16,
"nullable": true,
"pattern": "^[a-zA-Z0-9]*$"
}
}
},
Expand Down Expand Up @@ -3632,10 +3635,11 @@
"example": "6789"
},
"internationalPostalCode": {
"description": "International postal code for the Veteran's new address. Requried if 'country' is not 'USA'. Do not include if 'country' is 'USA'.",
"description": "International postal code for the Veteran's new address. Do not include if 'country' is 'USA'.",
"type": "string",
"maxLength": 100,
"nullable": true
"maxLength": 16,
"nullable": true,
"pattern": "^[a-zA-Z0-9]*$"
},
"dates": {
"type": "object",
Expand Down Expand Up @@ -5069,7 +5073,7 @@
"202 without a transactionId": {
"value": {
"data": {
"id": "925698c0-acd8-4155-80ba-6aed534825da",
"id": "40167e4f-703f-48bb-9c06-eea907988788",
"type": "forms/526",
"attributes": {
"claimId": "600442191",
Expand Down Expand Up @@ -5254,7 +5258,7 @@
},
"federalActivation": {
"activationDate": "2023-10-01",
"anticipatedSeparationDate": "2024-08-31"
"anticipatedSeparationDate": "2024-09-07"
},
"confinements": [
{
Expand Down Expand Up @@ -5300,7 +5304,7 @@
"202 with a transactionId": {
"value": {
"data": {
"id": "285b02b0-6a6b-4a57-ba90-77a7cfc01e0c",
"id": "917204da-61f3-4f0d-a2a5-e5a423b44c1a",
"type": "forms/526",
"attributes": {
"claimId": "600442191",
Expand Down Expand Up @@ -5678,10 +5682,11 @@
"nullable": true
},
"internationalPostalCode": {
"description": "International postal code for the Veteran's current mailing address. Required if 'country' is not 'USA'. Do not include if 'country' is 'USA'.",
"description": "International postal code for the Veteran's current mailing address. Do not include if 'country' is 'USA'.",
"type": "string",
"maxLength": 100,
"nullable": true
"maxLength": 16,
"nullable": true,
"pattern": "^[a-zA-Z0-9]*$"
}
}
},
Expand Down Expand Up @@ -5787,10 +5792,11 @@
"example": "6789"
},
"internationalPostalCode": {
"description": "International postal code for the Veteran's new address. Requried if 'country' is not 'USA'. Do not include if 'country' is 'USA'.",
"description": "International postal code for the Veteran's new address. Do not include if 'country' is 'USA'.",
"type": "string",
"maxLength": 100,
"nullable": true
"maxLength": 16,
"nullable": true,
"pattern": "^[a-zA-Z0-9]*$"
},
"dates": {
"type": "object",
Expand Down Expand Up @@ -7058,10 +7064,11 @@
"nullable": true
},
"internationalPostalCode": {
"description": "International postal code for the Veteran's current mailing address. Required if 'country' is not 'USA'. Do not include if 'country' is 'USA'.",
"description": "International postal code for the Veteran's current mailing address. Do not include if 'country' is 'USA'.",
"type": "string",
"maxLength": 100,
"nullable": true
"maxLength": 16,
"nullable": true,
"pattern": "^[a-zA-Z0-9]*$"
}
}
},
Expand Down Expand Up @@ -7167,10 +7174,11 @@
"example": "6789"
},
"internationalPostalCode": {
"description": "International postal code for the Veteran's new address. Requried if 'country' is not 'USA'. Do not include if 'country' is 'USA'.",
"description": "International postal code for the Veteran's new address. Do not include if 'country' is 'USA'.",
"type": "string",
"maxLength": 100,
"nullable": true
"maxLength": 16,
"nullable": true,
"pattern": "^[a-zA-Z0-9]*$"
},
"dates": {
"type": "object",
Expand Down Expand Up @@ -9215,10 +9223,11 @@
"nullable": true
},
"internationalPostalCode": {
"description": "International postal code for the Veteran's current mailing address. Required if 'country' is not 'USA'. Do not include if 'country' is 'USA'.",
"description": "International postal code for the Veteran's current mailing address. Do not include if 'country' is 'USA'.",
"type": "string",
"maxLength": 100,
"nullable": true
"maxLength": 16,
"nullable": true,
"pattern": "^[a-zA-Z0-9]*$"
}
}
},
Expand Down Expand Up @@ -9324,10 +9333,11 @@
"example": "6789"
},
"internationalPostalCode": {
"description": "International postal code for the Veteran's new address. Requried if 'country' is not 'USA'. Do not include if 'country' is 'USA'.",
"description": "International postal code for the Veteran's new address. Do not include if 'country' is 'USA'.",
"type": "string",
"maxLength": 100,
"nullable": true
"maxLength": 16,
"nullable": true,
"pattern": "^[a-zA-Z0-9]*$"
},
"dates": {
"type": "object",
Expand Down Expand Up @@ -10506,7 +10516,7 @@
"application/json": {
"example": {
"data": {
"id": "4e010a53-2107-486a-b006-5e98b8394c15",
"id": "555d0e33-d296-465c-b054-ab459381dc3e",
"type": "forms/526",
"attributes": {
"claimProcessType": "STANDARD_CLAIM_PROCESS",
Expand Down Expand Up @@ -14166,8 +14176,8 @@
"id": "1",
"type": "intent_to_file",
"attributes": {
"creationDate": "2024-08-29",
"expirationDate": "2025-08-29",
"creationDate": "2024-09-05",
"expirationDate": "2025-09-05",
"type": "compensation",
"status": "active"
}
Expand Down Expand Up @@ -15063,7 +15073,7 @@
"application/json": {
"example": {
"data": {
"id": "fb3346c4-25c3-45fb-bb7c-99edeb99c5f5",
"id": "2042b892-b0c9-4551-8c90-55538b3d6324",
"type": "individual",
"attributes": {
"code": "067",
Expand Down Expand Up @@ -15756,7 +15766,7 @@
"application/json": {
"example": {
"data": {
"id": "14b7e4ed-1537-479c-ab98-fb65eb97ef18",
"id": "378415a5-f585-44ac-9a66-f97891a7c116",
"type": "organization",
"attributes": {
"code": "083",
Expand Down Expand Up @@ -17707,10 +17717,10 @@
"application/json": {
"example": {
"data": {
"id": "7ab0c254-3162-45fd-87dd-dc44d14cb2f9",
"id": "b17376c2-39a2-44a5-a4bd-3a9d2b1de18f",
"type": "claimsApiPowerOfAttorneys",
"attributes": {
"dateRequestAccepted": "2024-08-29",
"dateRequestAccepted": "2024-09-05",
"previousPoa": null,
"representative": {
"serviceOrganization": {
Expand Down
Loading

0 comments on commit 430a1e3

Please sign in to comment.