app/repositories/hearing_repository.rb
# Maps attributes on a VACOLS case hearing to attributes on a Caseflow legacy hearing.
#
# @note Avoid triggering an indirect additional VACOLS load by avoiding calls to the
#   `hearing` parameter.
#
# @param hearing       [LegacyHearing] an uninitialized Caseflow legacy hearing
# @param vacols_record [VACOLS::CaseHearing] a VACOLS case hearing
#
# @return [Hash]
#   A hash of setter names on a `LegacyHearing` to values
#
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
Maps attributes on a VACOLS case hearing to attributes on a Caseflow legacy hearing.
Maps attributes on a VACOLS case hearing to attributes on a Caseflow legacy hearing .
def vacols_attributes(hearing, vacols_record)
      date = HearingMapper.datetime_based_on_type(
        datetime: vacols_record.hearing_date,
        regional_office: regional_office_for_scheduled_timezone(hearing, vacols_record),
        type: vacols_record.hearing_type
      )
      {
        vacols_record: vacols_record,
        appeal_vacols_id: vacols_record.folder_nr,
        venue_key: vacols_record.hearing_venue,
        disposition: VACOLS::CaseHearing::HEARING_DISPOSITIONS[vacols_record.hearing_disp.try(:to_sym)],
        representative_name: vacols_record.repname,
        aod: VACOLS::CaseHearing::HEARING_AODS[vacols_record.aod.try(:to_sym)],
        hold_open: vacols_record.holddays,
        transcript_requested: VACOLS::CaseHearing::BOOLEAN_MAP[vacols_record.tranreq.try(:to_sym)],
        transcript_sent_date: AppealRepository.normalize_vacols_date(vacols_record.transent),
        add_on: VACOLS::CaseHearing::BOOLEAN_MAP[vacols_record.addon.try(:to_sym)],
        notes: vacols_record.notes1,
        appeal_type: VACOLS::Case::TYPES[vacols_record.bfac],
        docket_number: vacols_record.tinum || "Missing Docket Number",
        veteran_first_name: vacols_record.snamef,
        veteran_middle_initial: vacols_record.snamemi,
        veteran_last_name: vacols_record.snamel,
        appellant_first_name: vacols_record.sspare2,
        appellant_middle_initial: vacols_record.sspare3,
        appellant_last_name: vacols_record.sspare1,
        room: vacols_record.room,
        request_type: vacols_record.hearing_type,
        scheduled_for: date,
        hearing_day_vacols_id: vacols_record.vdkey,
        bva_poc: vacols_record.vdbvapoc,
        judge_id: hearing.user_id
      }
    end
def vacols_attributes ( hearing , vacols_record ) date = HearingMapper . datetime_based_on_type ( datetime : vacols_record . hearing_date , regional_office : regional_office_for_scheduled_timezone ( hearing , vacols_record ) , type : vacols_record . hearing_type ) { vacols_record : vacols_record , appeal_vacols_id : vacols_record . folder_nr , venue_key : vacols_record . hearing_venue , disposition : VACOLS :: CaseHearing :: HEARING_DISPOSITIONS [ vacols_record . hearing_disp . try ( :to_sym ) ] , representative_name : vacols_record . repname , aod : VACOLS :: CaseHearing :: HEARING_AODS [ vacols_record . aod . try ( :to_sym ) ] , hold_open : vacols_record . holddays , transcript_requested : VACOLS :: CaseHearing :: BOOLEAN_MAP [ vacols_record . tranreq . try ( :to_sym ) ] , transcript_sent_date : AppealRepository . normalize_vacols_date ( vacols_record . transent ) , add_on : VACOLS :: CaseHearing :: BOOLEAN_MAP [ vacols_record . addon . try ( :to_sym ) ] , notes : vacols_record . notes1 , appeal_type : VACOLS :: Case :: TYPES [ vacols_record . bfac ] , docket_number : vacols_record . tinum || "Missing Docket Number" , veteran_first_name : vacols_record . snamef , veteran_middle_initial : vacols_record . snamemi , veteran_last_name : vacols_record . snamel , appellant_first_name : vacols_record . sspare2 , appellant_middle_initial : vacols_record . sspare3 , appellant_last_name : vacols_record . sspare1 , room : vacols_record . room , request_type : vacols_record . hearing_type , scheduled_for : date , hearing_day_vacols_id : vacols_record . vdkey , bva_poc : vacols_record . vdbvapoc , judge_id : hearing . user_id } end
Maps attributes on a VACOLS case hearing to attributes on a Caseflow legacy hearing.
Maps attributes on a VACOLS case hearing to attributes on a Caseflow legacy hearing .
A hash of setter names on a `LegacyHearing` to values rubocop:disable Metrics/AbcSize, Metrics/MethodLength
A hash of setter names on a ` LegacyHearing ` to values rubocop : disable Metrics / AbcSize Metrics / MethodLength
Hash
hearing
an uninitialized Caseflow legacy hearing
an uninitialized Caseflow legacy hearing
vacols_record
a VACOLS case hearing
a VACOLS case hearing
note
Avoid triggering an indirect additional VACOLS load by avoiding calls to the `hearing` parameter.
Avoid triggering an indirect additional VACOLS load by avoiding calls to the ` hearing ` parameter .