Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonhoc committed Sep 4, 2024
1 parent d9b6929 commit 5eddcca
Showing 1 changed file with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def build_appointment_model
private

def appointment_request?
requested_periods.present?
appointment[:requested_periods].present?
end

# to match web behavior, prefer the value found in the practitioners list over the preferred_provider_name.
Expand Down Expand Up @@ -231,36 +231,26 @@ def contact(telecom, type)
end

def proposed_times
return nil if requested_periods.nil?

requested_periods.map do |period|
date, time = begin
start_date = time_to_datetime(period[:start])
date = start_date.strftime('%m/%d/%Y')
time = start_date.hour.zero? ? 'AM' : 'PM'
[date, time]
end
return nil if appointment[:requested_periods].nil?

{
date:,
time:
}
appointment[:requested_periods].map do |period|
start_date = time_to_datetime(period[:start])
date = start_date.strftime('%m/%d/%Y')
time = start_date.hour.zero? ? 'AM' : 'PM'
{ date:, time: }
end
end

def status
STATUSES[appointment[:status].to_sym]
end

def requested_periods
@requested_periods ||= appointment[:requested_periods]
end

Check failure on line 248 in modules/mobile/app/models/mobile/v0/adapters/vaos_v2_appointment.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/EmptyLines: Extra blank line detected.
def start_date_utc

Check failure on line 249 in modules/mobile/app/models/mobile/v0/adapters/vaos_v2_appointment.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
@start_date_utc ||= begin
start = appointment[:start]
if start.nil?
sorted_dates = requested_periods.map do |period|
sorted_dates = appointment[:requested_periods].map do |period|
time_to_datetime(period[:start])
end.sort
future_dates = sorted_dates.select { |period| period > DateTime.now }
Expand Down

0 comments on commit 5eddcca

Please sign in to comment.