modules/mobile/config/routes.rb
# frozen_string_literal: true

Mobile::Engine.routes.draw do
  get '/', to: 'discovery#welcome'

  namespace :v0 do
    get '/feature-toggles', to: 'feature_toggles#index'
    get '/appeal/:id', to: 'claims_and_appeals#get_appeal'
    get '/appointments', to: 'appointments#index'
    put '/appointments/cancel/:id', to: 'appointments#cancel'
    get '/appointments/community_care/eligibility/:service_type', to: 'community_care_eligibility#show'
    get '/appointments/va/eligibility', to: 'veterans_affairs_eligibility#show'
    get '/appointments/facility/eligibility', to: 'facility_eligibility#index'
    get '/appointments/facilities/:facility_id/clinics', to: 'clinics#index'
    get '/appointments/facilities/:facility_id/clinics/:clinic_id/slots', to: 'clinics#slots'
    get '/appointments/facilities/:facility_id/slots', to: 'clinics#facility_slots'
    post '/appointments/check-in', to: 'check_in#create'
    patch '/appointments/check-in/demographics', to: 'check_in_demographics#update'
    post '/appointment', to: 'appointments#create'
    get '/appointments/check-in/demographics', to: 'check_in_demographics#show'
    get '/awards', to: 'awards#index'
    get '/pensions', to: 'pensions#index'
    get '/claims-and-appeals-overview', to: 'claims_and_appeals#index'
    get '/claims/decision-letters', to: 'decision_letters#index'
    get '/claims/decision-letters/:document_id/download', to: 'decision_letters#download'
    post '/claims/pre-need-burial', to: 'pre_need_burial#create'
    get '/claims/pre-need-burial/cemeteries', to: 'cemeteries#index'
    get '/claim/:id', to: 'claims_and_appeals#get_claim'
    post '/claim/:id/documents', to: 'claims_and_appeals#upload_document'
    post '/claim/:id/documents/multi-image', to: 'claims_and_appeals#upload_multi_image_document'
    post '/claim/:id/request-decision', to: 'claims_and_appeals#request_decision'
    get '/claim-letter/documents', to: 'claims_and_appeals#claim_letter_documents_search'
    post '/claim-letter/documents/:document_id/download', to: 'claims_and_appeals#claim_letter_document_download'
    get '/community-care-providers', to: 'community_care_providers#index'
    get '/debts', to: 'debts#index'
    get '/debts/:id', to: 'debts#show'
    get '/dependents', to: 'dependents#index'
    post '/dependents', to: 'dependents#create'
    get '/dependents/request-decisions', to: 'dependents_request_decisions#index'
    get '/disability-rating', to: 'disability_rating#index'
    get '/enrollment-status', to: 'enrollment_status#show'
    get '/efolder/documents', to: 'efolder#index'
    post '/efolder/documents/:document_id/download', to: 'efolder#download'
    get '/facilities-info', to: 'facilities_info#index'
    get '/facilities-info/:sort', to: 'facilities_info#schedulable'
    post '/financial-status-reports/download', to: 'financial_status_reports#download'
    get '/health/immunizations', to: 'immunizations#index'
    get '/health/locations/:id', to: 'locations#show'
    scope :health do
      get 'labs-and-tests', to: 'labs_and_tests#index'
      resources :observations, only: %i[show]
      get 'allergy-intolerances', to: 'allergy_intolerances#index'
    end
    get '/letters', to: 'letters#index'
    get '/letters/beneficiary', to: 'letters#beneficiary'
    post '/letters/:type/download', to: 'letters#download'
    get '/maintenance_windows', to: 'maintenance_windows#index'
    resources :medical_copays, only: %i[index show]
    get '/medical_copays/download/:id', to: 'medical_copays#download'
    get '/messaging/health/folders', to: 'folders#index'
    post '/messaging/health/folders', to: 'folders#create'
    get '/messaging/health/folders/:folder_id/messages', to: 'messages#index'
    get '/messaging/health/folders/:folder_id/threads', to: 'threads#index'
    get '/messaging/health/folders/:id', to: 'folders#show', as: 'folder'
    delete '/messaging/health/folders/:id', to: 'folders#destroy'
    post '/messaging/health/messages', to: 'messages#create'
    get '/messaging/health/messages/categories', to: 'messages#categories'
    get '/messaging/health/messages/signature', to: 'messages#signature'
    delete '/messaging/health/messages/:id', to: 'messages#destroy'
    get '/messaging/health/messages/:id', to: 'messages#show', as: 'message'
    patch '/messaging/health/messages/:id/move', to: 'messages#move'
    post '/messaging/health/messages/:id/reply', to: 'messages#reply'
    get '/messaging/health/messages/:id/thread', to: 'messages#thread'
    get '/messaging/health/messages/:message_id/attachments/:id', to: 'attachments#show', as: 'message_attachment'
    post '/messaging/health/message_drafts/:reply_id/replydraft', to: 'message_drafts#create_reply_draft'
    put '/messaging/health/message_drafts/:reply_id/replydraft/:draft_id', to: 'message_drafts#update_reply_draft'
    post '/messaging/health/message_drafts', to: 'message_drafts#create'
    patch '/messaging/health/message_drafts/:id', to: 'message_drafts#update'
    put '/messaging/health/message_drafts/:id', to: 'message_drafts#update'
    get '/messaging/health/recipients', to: 'recipients#recipients'
    get '/messaging/health/allrecipients', to: 'recipients#all_recipients'
    get '/military-service-history', to: 'military_information#get_service_history'
    get '/payment-history', to: 'payment_history#index'
    get '/payment-information/benefits', to: 'payment_information#index'
    put '/payment-information/benefits', to: 'payment_information#update'
    put '/push/register', to: 'push_notifications#register'
    get '/push/prefs/:endpoint_sid', to: 'push_notifications#get_prefs'
    put '/push/prefs/:endpoint_sid', to: 'push_notifications#set_pref'
    post '/push/send', to: 'push_notifications#send_notification'
    get '/translations/download', to: 'translations#download'
    post '/travel-pay/claims', to: 'travel_pay_claims#create'
    get '/travel-pay/claims', to: 'travel_pay_claims#index'
    get '/travel-pay/claims/:id', to: 'travel_pay_claims#show'
    get '/user', to: 'users#show'
    get '/user/authorized-services', to: 'authorized_services#index'
    get '/user/contact-info', to: 'contact_info#show'
    post '/user/logged-in', to: 'users#logged_in'
    get '/user/logout', to: 'users#logout'
    post '/user/addresses', to: 'addresses#create'
    put '/user/addresses', to: 'addresses#update'
    delete '/user/addresses', to: 'addresses#destroy'
    post '/user/addresses/validate', to: 'addresses#validate'
    post '/user/emails', to: 'emails#create'
    put '/user/emails', to: 'emails#update'
    delete '/user/emails', to: 'emails#destroy'
    get '/user/gender_identity/edit', to: 'gender_identity#edit'
    put '/user/gender_identity', to: 'gender_identity#update'
    post '/user/phones', to: 'phones#create'
    put '/user/phones', to: 'phones#update'
    delete '/user/phones', to: 'phones#destroy'
    put '/user/preferred_name', to: 'preferred_names#update'
    get '/user/demographics', to: 'demographics#index'
    get '/health/rx/prescriptions', to: 'prescriptions#index'
    put '/health/rx/prescriptions/refill', to: 'prescriptions#refill'
    get '/health/rx/prescriptions/:id/tracking', to: 'prescriptions#tracking'
    get '/vet_verification_status', to: 'vet_verification_statuses#show'
  end

  namespace :v1 do
    get '/health/immunizations', to: 'immunizations#index'
    get '/health/labs-and-tests', to: 'labs_and_tests#index'
    get '/health/rx/prescriptions', to: 'prescriptions#index'
    put '/health/rx/prescriptions/refill', to: 'prescriptions#refill'
    get '/messaging/health/messages/:id/thread', to: 'messages#thread'
    get '/user', to: 'users#show'
  end

  namespace :v2 do
    get '/user', to: 'users#show'
  end
end
