You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In AppointmentsController, we make a call to EPS get_drive_times method which requires the current_user's latitude/longitude. This ticket is to confirm that we can retrieve that using the correct vets-api method.
Tasks
[BE] get current_user's latitude/longitude
Acceptance Criteria
Deployed to staging
Tested on staging
The text was updated successfully, but these errors were encountered:
@randomsync taking a look at your proposed fetch_drive_times method it appears that you were hopeful to access the user's lat and long through the data made available from the MPI service:
Taking a look elsewhere in the user model, I can see that there is additional demographic data made available through the vet360_contact_infomethod which appears to have access to the user's latitude and longitude via the VaProfile::Models::V3::BaseAddressmodule.
I am unsure at how feasible this solution is since originally it seems the source of truth for the user's address for the purposes of creating this appointment is intended to come from from the MPI service, as well as the fact that this potential solution assumes the user has a vet360_id and the required data for the user is available from the Vet360 service.
I’ve confirmed that the latitude and longitude fields are already included in the vet360ContactInformation attribute of the user object on the frontend. This data comes from the VA Profile (Vet360) service and is pulled in during the authentication flow. On the backend, it’s fetched via the vet360_contact_info method in the User model, which calls VAProfile::V2::ContactInformation::Service.
The key pieces involved in making this data available are:
Endpoint: /v0/user, which returns the serialized user object.
User Serializer: Adds vet360ContactInformation to the user object.
VA Profile Service (VAProfile::ContactInformation::Service): Retrieves the user’s address data, including latitude and longitude.
Address Model: VAProfile::Models::V3::Address maps latitude and longitude from the API response.
In AppointmentsController, we make a call to EPS get_drive_times method which requires the current_user's latitude/longitude. This ticket is to confirm that we can retrieve that using the correct vets-api method.
Tasks
Acceptance Criteria
The text was updated successfully, but these errors were encountered: