Create unified slots service for CC Hybrid scheduling#27602
Create unified slots service for CC Hybrid scheduling#27602lee-delarm6 merged 11 commits intomasterfrom
Conversation
2964501 to
14616ab
Compare
Replace facility-level from_lighthouse_facility with clinic construction from a Lighthouse facility plus a VAOS clinic payload.
14616ab to
30d8775
Compare
After filtering Lighthouse facilities by referral category_of_care, fetch VAOS clinics per facility and build VAProvider with from_facility_and_clinic.
Add AvailabilityAdapter for VA clinic and EPS slot fetches.
51d82e0 to
762942d
Compare
| svc.to_s.downcase.gsub(/[\s_-]+/, '') == normalized | ||
| end | ||
| facilities.select do |facility| | ||
| eligibility_service.check_eligibility( |
There was a problem hiding this comment.
FYI I updated this section to use the eligibility checks instead since this is closer to the production behavior.
| 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) |
There was a problem hiding this comment.
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:
- check eligibility at each facility
- fetch clinics at each eligible facility
PhilipDeFraties
left a comment
There was a problem hiding this comment.
left some in-line comments
JunTaoLuo
left a comment
There was a problem hiding this comment.
PR updated to address feedback.
lee-delarm6
left a comment
There was a problem hiding this comment.
Looks good, thanks for reviewing it first Phil as well
There was a problem hiding this comment.
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::SlotsServiceto 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 ofschedulable_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. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
aa5a76a
PhilipDeFraties
left a comment
There was a problem hiding this comment.
small change to an error message, no other changes since last approval, still g2g
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
Related issue(s)
Testing done
What areas of the site does it impact?
Appointments
Acceptance criteria