Skip to content

Claim status tool cards champva be#27235

Merged
ksantiagoBAH merged 16 commits intomasterfrom
Claim-status-tool-cards-champva-BE
Apr 6, 2026
Merged

Claim status tool cards champva be#27235
ksantiagoBAH merged 16 commits intomasterfrom
Claim-status-tool-cards-champva-BE

Conversation

@ksantiagoBAH
Copy link
Copy Markdown
Contributor

@ksantiagoBAH ksantiagoBAH commented Mar 24, 2026

Keep your PR as a Draft until it's ready for Platform review. A PR is ready for Platform review when it has a teammate approval and tests, linting, and settings checks pass CI. See these tips on how to avoid common delays in getting your PR merged.

Summary

  • This work is behind a feature toggle (flipper): YES
  • Adds CHAMPVA claim-status metadata configuration support using JSON files and a shared loader, so provider-specific CST content can be managed without Ruby object edits.
  • Adds/updates multi-provider plumbing for benefits claims (including provider type handling used by vets-website details routes).
  • Adds backend CHAMPVA custom-content gate via flipper cst_champva_custom_content so API can suppress CHAMPVA metadata when disabled.
  • Prior behavior:
    • CHAMPVA metadata was effectively always returned once provider path was used.
    • Some provider-type query combinations could produce request/lookup mismatch and 400 behavior in local integration.
  • Solution:
    • Centralized metadata in JSON (config/benefits_claims/claim_status_meta/...) and load it through a dedicated loader.
    • Gate CHAMPVA metadata generation in IVC claim builder with Flipper.enabled?(:cst_champva_custom_content, user).
    • Keep provider registry + mapping behavior explicit for stable multi-provider routing.
  • Team ownership:
    • Benefits / Claims Status Tool multi-provider workstream. Team owns maintenance for this component path.
  • Flipper success criteria:
    • Enable cst_champva_custom_content for controlled cohorts and confirm CHAMPVA detail/list content parity on vets-website with no CST legacy regressions.
    • Maintain low/no increase in claims status errors (400/500) during rollout.
    • Remove/relax toggle after rollout confidence window and monitoring review.

Related issue(s)

department-of-veterans-affairs/vets-website#43437
department-of-veterans-affairs/va.gov-team#136629

Testing done

  • New code is covered by unit tests
  • Old behavior:
    • CHAMPVA metadata response content was not independently controllable from provider routing.
    • Frontend/provider integration could fail for some type values when resolving details.
  • Manual verification steps used:
    1. Start local vets-api + vets-website with multi-provider flow enabled.
    2. Request CHAMPVA claim details endpoint with CHAMPVA provider type and verify 200 response.
    3. Verify response includes CHAMPVA claimStatusMeta when flipper cst_champva_custom_content is ON.
    4. Disable cst_champva_custom_content and verify CHAMPVA response omits/suppresses custom metadata while claim record still resolves.
    5. Confirm standard Lighthouse claims are unaffected.
  • Automated checks completed:
    • Ruby syntax checks on touched files (ruby -c) passed.
    • JSON config parse checks (jq empty) passed.
  • If this work is behind a flipper:
    • Tests should cover both flipper ON and OFF scenarios for CHAMPVA metadata.
    • Rollout plan:
      1. Enable in dev/staging for internal users.
      2. Validate CHAMPVA list/detail parity with vets-website.
      3. Monitor API error rates and response-shape issues.
      4. Expand audience gradually.

Note: If backend unit specs for ON/OFF are not yet added in this PR, keep this as Draft and add them before requesting Platform review.

Screenshots

Note: Optional

N/A (API/backend-only behavior)

What areas of the site does it impact?

  • GET /v0/benefits_claims aggregated claim list behavior for CHAMPVA provider entries
  • GET /v0/benefits_claims/:id provider-specific detail behavior
  • CST UI content on vets-website where claimStatusMeta is consumed (status/details/files/overview/list card/help copy)

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

Please focus review on:

  1. Flipper boundary for cst_champva_custom_content (metadata on/off response behavior)
  2. Provider type mapping and backward compatibility in multi-provider detail requests
  3. Whether we should require a strict response contract test for CHAMPVA metadata shape before enabling in production

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: config/benefits_claims/claim_status_meta/ivc_champva/default.json

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

1 Warning
⚠️ This PR changes 291 lines of code (not counting whitespace/newlines, comments, or test files).

In order to ensure each PR receives the proper attention it deserves, we recommend not exceeding
200. Expect some delays getting reviews.

File Summary

Files

  • .github/CODEOWNERS (+3/-0)

  • app/controllers/v0/concerns/multi_provider_support.rb (+9/-2)

  • config/features.yml (+4/-0)

  • config/initializers/benefits_claims_providers.rb (+9/-0)

  • lib/benefits_claims/claim_status_meta/config_loader.rb (+35/-0)

  • lib/benefits_claims/concerns/multi_provider_base.rb (+5/-3)

  • lib/benefits_claims/providers/ivc_champva/claim_builder.rb (+124/-0)

  • lib/benefits_claims/providers/ivc_champva/claim_serializer.rb (+12/-0)

  • lib/benefits_claims/providers/ivc_champva/ivc_champva_benefits_claims_provider.rb (+49/-0)

  • lib/benefits_claims/providers/lighthouse/builders/claim_status_meta_builder.rb (+30/-0)

  • lib/benefits_claims/providers/lighthouse/claim_builder.rb (+3/-1)

  • lib/benefits_claims/providers/lighthouse/claim_serializer.rb (+1/-0)

  • lib/benefits_claims/responses/claim_response.rb (+1/-0)

    Note: We exclude files matching the following when considering PR size:

    *.csv, *.json, *.tsv, *.txt, *.md, Gemfile.lock, app/swagger, modules/mobile/docs, spec/fixtures/, spec/support/vcr_cassettes/, modules/mobile/spec/support/vcr_cassettes/, db/seeds, modules/vaos/app/docs, modules/meb_api/app/docs, modules/appeals_api/app/swagger/, *.bru, *.pdf, modules/*/spec/fixtures/*, modules/*/spec/factories/*, modules/*/spec/**/*.rb, spec/**/*.rb, modules/*/docs/**/*.yaml, modules/*/docs/**/*.yml, modules/*/app/docs/**/*.yaml, modules/*/app/docs/**/*.yml
    

Big PRs are difficult to review, often become stale, and cause delays.

Generated by 🚫 Danger

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: config/benefits_claims/claim_status_meta/ivc_champva/default.json

@va-vsp-bot
Copy link
Copy Markdown
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: lib/benefits_claims/claim_status_meta/config_loader.rb

@ksantiagoBAH ksantiagoBAH force-pushed the Claim-status-tool-cards-champva-BE branch from 9f58de7 to 11225dc Compare March 24, 2026 13:06
@va-vsp-bot
Copy link
Copy Markdown
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: lib/benefits_claims/claim_status_meta/config_loader.rb

breedbah
breedbah previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Contributor

@breedbah breedbah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@ksantiagoBAH ksantiagoBAH marked this pull request as ready for review March 25, 2026 13:48
@ksantiagoBAH ksantiagoBAH requested a review from a team as a code owner March 25, 2026 13:48
Copilot AI review requested due to automatic review settings March 25, 2026 13:48
@ksantiagoBAH ksantiagoBAH requested a review from a team as a code owner March 25, 2026 13:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurable Claim Status Tool (CST) “claimStatusMeta” content via provider-scoped JSON files and a shared loader, and wires in an IVC CHAMPVA benefits-claims provider with multi-provider routing and a CHAMPVA custom-content feature gate.

Changes:

  • Introduces BenefitsClaims::ClaimStatusMeta::ConfigLoader and provider JSON configs for claimStatusMeta.
  • Adds IVC CHAMPVA provider plumbing + legacy provider-type alias mapping for backward compatibility.
  • Extends claim DTO/serialization to optionally include claimStatusMeta and adds feature flag cst_champva_custom_content.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
spec/controllers/v0/concerns/multi_provider_support_spec.rb Adds coverage for legacy provider-type alias mapping.
spec/controllers/v0/benefits_claims_controller_spec.rb Updates expectations for supported provider types.
lib/benefits_claims/responses/claim_response.rb Extends canonical claim DTO to include claim_status_meta.
lib/benefits_claims/providers/lighthouse/claim_serializer.rb Serializes claimStatusMeta when present.
lib/benefits_claims/providers/lighthouse/claim_builder.rb Populates DTO with Lighthouse claim_status_meta.
lib/benefits_claims/providers/lighthouse/builders/claim_status_meta_builder.rb Loads Lighthouse metadata config via shared loader.
lib/benefits_claims/providers/ivc_champva/ivc_champva_benefits_claims_provider.rb New provider for IVC CHAMPVA claim list/detail retrieval.
lib/benefits_claims/providers/ivc_champva/claim_serializer.rb Reuses Lighthouse serializer for JSON:API shaping.
lib/benefits_claims/providers/ivc_champva/claim_builder.rb Builds CHAMPVA claim DTOs + flipper-gated claim_status_meta.
lib/benefits_claims/concerns/multi_provider_base.rb Tightens claim lookup validation across providers.
lib/benefits_claims/claim_status_meta/config_loader.rb New JSON loader with production caching behavior.
config/initializers/benefits_claims_providers.rb Registers :ivc_champva provider in the registry.
config/features.yml Adds cst_champva_custom_content feature toggle entry.
config/benefits_claims/claim_status_meta/lighthouse/default.json Adds Lighthouse default metadata JSON.
config/benefits_claims/claim_status_meta/ivc_champva/default.json Adds IVC CHAMPVA default metadata JSON.
app/controllers/v0/concerns/multi_provider_support.rb Adds provider type mappings including legacy alias.
.github/CODEOWNERS Adds ownership for new config and loader directories.

Comment thread lib/benefits_claims/providers/ivc_champva/claim_builder.rb
private

def cached_config(provider_name, variant_name)
Rails.cache.fetch("benefits_claims/claim_status_meta/#{provider_name}/#{variant_name}") do
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rails.cache.fetch here has no TTL or deploy/versioned cache key. In production cache stores (Redis/Memcached), this can cause stale JSON metadata to survive deploys/updates. Consider adding expires_in and/or incorporating the file mtime/app version into the cache key to ensure new JSON content takes effect predictably.

Suggested change
Rails.cache.fetch("benefits_claims/claim_status_meta/#{provider_name}/#{variant_name}") do
file_path = BASE_PATH.join(provider_name, "#{variant_name}.json")
file_version = File.exist?(file_path) ? File.mtime(file_path).to_i : 'missing'
cache_key = "benefits_claims/claim_status_meta/#{provider_name}/#{variant_name}/#{file_version}"
Rails.cache.fetch(cache_key, expires_in: 1.hour) do

Copilot uses AI. Check for mistakes.
Comment on lines +124 to +128
def self.include_champva_custom_content?(user)
return true unless defined?(Flipper)

Flipper.enabled?(:cst_champva_custom_content, user)
end
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature-flagged behavior (cst_champva_custom_content) is new and affects the response shape (presence/absence of claimStatusMeta). Add specs that assert both Flipper ON and OFF outcomes for CHAMPVA claims so the rollout gate is protected against regressions.

Copilot generated this review using guidance from repository custom instructions.
Comment thread lib/benefits_claims/providers/lighthouse/claim_builder.rb
swillisdev
swillisdev previously approved these changes Mar 25, 2026
Copy link
Copy Markdown

@swillisdev swillisdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and working

Comment thread app/controllers/v0/concerns/multi_provider_support.rb Outdated
jweissman
jweissman previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Contributor

@jweissman jweissman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking objections (but maybe good to confirm parts of this aren't superseded by #27271)

Comment thread app/controllers/v0/concerns/multi_provider_support.rb Outdated
Comment thread lib/benefits_claims/providers/ivc_champva/ivc_champva_benefits_claims_provider.rb Outdated
@ksantiagoBAH
Copy link
Copy Markdown
Contributor Author

Look like I have to resolve some conflicts here, I'll push that shortly.

@ksantiagoBAH ksantiagoBAH dismissed stale reviews from jweissman, swillisdev, and breedbah via e2e1ca5 March 25, 2026 21:14
@ksantiagoBAH ksantiagoBAH force-pushed the Claim-status-tool-cards-champva-BE branch from ec495b6 to e2e1ca5 Compare March 25, 2026 21:14
@ksantiagoBAH ksantiagoBAH force-pushed the Claim-status-tool-cards-champva-BE branch from 0b96bff to a5a2840 Compare March 31, 2026 19:57
nathangthomas
nathangthomas previously approved these changes Mar 31, 2026
Copy link
Copy Markdown
Contributor

@nathangthomas nathangthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM!

stiehlrod
stiehlrod previously approved these changes Apr 2, 2026
swillisdev
swillisdev previously approved these changes Apr 6, 2026
@ksantiagoBAH ksantiagoBAH merged commit 5754687 into master Apr 6, 2026
42 of 43 checks passed
@ksantiagoBAH ksantiagoBAH deleted the Claim-status-tool-cards-champva-BE branch April 6, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants