Skip to content

Commit

Permalink
VACMS-17114: Adds logic for getting ALL the phone numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
omahane committed Feb 18, 2024
1 parent c589a71 commit 735cb35
Showing 1 changed file with 1 addition and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,39 +347,6 @@ protected function getAppointmentLeadin() {
return $this->stringNullify($text);
}

/**
* Get the non-default service location appointment phone type.
*
* @param string $from_facility
* The value of a single service location's appointment phone type.
*
* @return string
* The type of service location text that the user chose.
*/
protected function getAppointmentPhoneType($from_facility) {
// If the class property's already set to the actionable non-default,
// bail out.
if (!empty($this->apptPhoneType)) {
return $this->apptPhoneType;
}
$map = [
// Value => Return.
// Lighthouse decided to receive these as strings since non-bool options.
'0' => 'false',
'1' => 'true',
];
return $map[$from_facility];
}

protected function getAppointmentPhones(array $phone_paragraphs = []) {
// If the class property's already set to the actionable non-default,
// bail out.
if (!empty($this->apptPhones)) {
return $this->apptPhones;
}
return $this->getPhones($this->apptPhoneType, $phone_paragraphs);
}

/**
* Gets the online scheduling value.
*
Expand Down Expand Up @@ -477,9 +444,7 @@ protected function getServiceLocations(): array {

// Set the appointment phone values to the non-default for the service.
$field_appt_phone_type = $location->get('field_use_facility_phone_number')->value;
$this->apptPhoneType = $this->getAppointmentPhoneType($field_appt_phone_type);
$this->apptPhones = $this->getAppointmentPhones($location->get('field_other_phone_numbers')->referencedEntities());

$this->apptPhones[] = $this->getPhones($field_appt_phone_type, $location->get('field_other_phone_numbers')->referencedEntities());

// Set the online scheduling value to yes for the service if so chosen.
$this->isOnlineSchedulingAvail = ($this->isOnlineSchedulingAvail !== 'false'
Expand Down

0 comments on commit 735cb35

Please sign in to comment.