Skip to content

Create unified slots service for CC Hybrid scheduling#27602

Merged
lee-delarm6 merged 11 commits intomasterfrom
jtluo/cc-hybrid-unified-availability
Apr 8, 2026
Merged

Create unified slots service for CC Hybrid scheduling#27602
lee-delarm6 merged 11 commits intomasterfrom
jtluo/cc-hybrid-unified-availability

Conversation

@JunTaoLuo
Copy link
Copy Markdown
Contributor

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): NO
  • (Summarize the changes that have been made to the platform)
  • Unified appointments experience

Related issue(s)

Testing done

  • New code is covered by unit tests

What areas of the site does it impact?

Appointments

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

@JunTaoLuo JunTaoLuo force-pushed the jtluo/cc-hybrid-unified-availability branch from 2964501 to 14616ab Compare April 6, 2026 19:43
Replace facility-level from_lighthouse_facility with clinic construction from a
Lighthouse facility plus a VAOS clinic payload.
@JunTaoLuo JunTaoLuo force-pushed the jtluo/cc-hybrid-unified-availability branch from 14616ab to 30d8775 Compare April 6, 2026 19:46
After filtering Lighthouse facilities by referral category_of_care, fetch VAOS
clinics per facility and build VAProvider with from_facility_and_clinic.
Comment thread modules/vaos/app/models/vaos/v2/unified/va_provider.rb
Add AvailabilityAdapter for VA clinic and EPS slot fetches.
@JunTaoLuo JunTaoLuo force-pushed the jtluo/cc-hybrid-unified-availability branch from 51d82e0 to 762942d Compare April 6, 2026 20:43
Comment thread modules/vaos/app/services/vaos/v2/unified/slot_adapter.rb Outdated
svc.to_s.downcase.gsub(/[\s_-]+/, '') == normalized
end
facilities.select do |facility|
eligibility_service.check_eligibility(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

FYI I updated this section to use the eligibility checks instead since this is closer to the production behavior.

Comment thread modules/vaos/app/services/vaos/v2/unified/slots_service.rb
providers = facilities.map { |f| VAOS::V2::Unified::VAProvider.from_lighthouse_facility(f) }
providers.each { |p| assign_distance(p, user_address) }
filter_va_by_category_of_care(providers, referral.category_of_care)
fetch_providers_for_facilities(facilities, referral, user_address)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looking at the UX flow and guessing at how this service is to be used, we'll want to produce a list of VA providers which are clinics not facilities. There really isn't any use for raw VA facilities so I'm updating the logic here to:

  1. check eligibility at each facility
  2. fetch clinics at each eligible facility

Comment thread modules/vaos/app/services/vaos/v2/unified/slots_service.rb Outdated
Comment thread modules/vaos/app/models/vaos/v2/unified/va_provider.rb Outdated
Copy link
Copy Markdown
Contributor

@PhilipDeFraties PhilipDeFraties left a comment

Choose a reason for hiding this comment

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

left some in-line comments

@JunTaoLuo JunTaoLuo changed the title Create unified availability adapter Create unified slots service for CC Hybrid scheduling Apr 7, 2026
Comment thread modules/vaos/app/models/vaos/v2/unified/eps_provider.rb
Comment thread modules/vaos/app/models/vaos/v2/unified/base_provider.rb
Copy link
Copy Markdown
Contributor Author

@JunTaoLuo JunTaoLuo left a comment

Choose a reason for hiding this comment

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

PR updated to address feedback.

Comment thread modules/vaos/app/models/vaos/v2/unified/eps_provider.rb
Comment thread modules/vaos/app/services/vaos/v2/unified/slots_service.rb
@PhilipDeFraties PhilipDeFraties self-requested a review April 7, 2026 19:11
PhilipDeFraties
PhilipDeFraties previously approved these changes Apr 7, 2026
lee-delarm6
lee-delarm6 previously approved these changes Apr 7, 2026
Copy link
Copy Markdown
Contributor

@lee-delarm6 lee-delarm6 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, thanks for reviewing it first Phil as well

@lee-delarm6 lee-delarm6 marked this pull request as ready for review April 7, 2026 19:38
@lee-delarm6 lee-delarm6 requested review from a team as code owners April 7, 2026 19:38
Copilot AI review requested due to automatic review settings April 7, 2026 19:38
@lee-delarm6 lee-delarm6 enabled auto-merge (squash) April 7, 2026 19:38
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 a unified “slots” abstraction and updates unified provider search to return VA clinics (from VAOS) alongside EPS community care providers, aligning the unified appointments experience with CC Hybrid scheduling needs.

Changes:

  • Introduces VAOS::V2::Unified::SlotsService to fetch/normalize availability from VAOS (VA clinics) and EPS (community care).
  • Updates unified provider search to build VA providers from Lighthouse facilities + VAOS clinics and to filter VA facilities via direct-scheduling eligibility when the referral category maps to a VAOS service.
  • Updates unified provider model/serializer surface area (e.g., facility_name, removal of schedulable_services) and adjusts specs accordingly.

Reviewed changes

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

Show a summary per file
File Description
modules/vaos/app/services/vaos/v2/unified/slots_service.rb New unified slots fetcher for VAOS + EPS providers.
modules/vaos/spec/services/vaos/v2/unified/slots_service_spec.rb Unit coverage for SlotsService behavior and parameter validation.
modules/vaos/app/services/vaos/v2/unified/provider_search_service.rb VA search now returns clinic-level providers and adds eligibility-based facility filtering.
modules/vaos/spec/services/vaos/v2/unified/provider_search_service_spec.rb Updates/expands provider search specs for clinic + eligibility behavior.
modules/vaos/app/services/vaos/v2/unified/eligibility_service.rb Changes API to accept facility_id: keyword (vs provider object).
modules/vaos/spec/services/vaos/v2/unified/eligibility_service_spec.rb Updates specs to match new EligibilityService signature.
modules/vaos/app/serializers/vaos/v2/unified_provider_serializer.rb Adds facilityName, removes schedulableServices.
modules/vaos/spec/serializers/vaos/v2/unified_provider_serializer_spec.rb Updates serializer expectations for new fields/shape.
modules/vaos/app/models/vaos/v2/unified/base_provider.rb Adds facility_name, removes schedulable_services.
modules/vaos/app/models/vaos/v2/unified/va_provider.rb VA provider now represents a clinic at a facility (from_facility_and_clinic).
modules/vaos/spec/models/vaos/v2/unified/va_provider_spec.rb Updates VA provider factory expectations for clinic+facility composition.
modules/vaos/app/models/vaos/v2/unified/eps_provider.rb Adds appointment_types and helper to select self-schedulable type id.
modules/vaos/spec/models/vaos/v2/unified/eps_provider_spec.rb Adds coverage for facility_name, appointment_types, and selection helper.
modules/vaos/spec/controllers/v2/providers_controller_index_spec.rb Updates controller spec fixtures for new provider attributes.

Comment thread modules/vaos/app/services/vaos/v2/unified/slots_service.rb Outdated
Comment thread modules/vaos/app/models/vaos/v2/unified/eps_provider.rb
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@JunTaoLuo JunTaoLuo dismissed stale reviews from lee-delarm6 and PhilipDeFraties via aa5a76a April 7, 2026 20:54
@PhilipDeFraties PhilipDeFraties self-requested a review April 7, 2026 21:20
Copy link
Copy Markdown
Contributor

@PhilipDeFraties PhilipDeFraties left a comment

Choose a reason for hiding this comment

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

small change to an error message, no other changes since last approval, still g2g

@lee-delarm6 lee-delarm6 merged commit 97d7728 into master Apr 8, 2026
42 of 46 checks passed
@lee-delarm6 lee-delarm6 deleted the jtluo/cc-hybrid-unified-availability branch April 8, 2026 14:27
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.

5 participants