# frozen_string_literal: true

Rails.application.routes.draw do
  namespace :id_card do
    resources :rx_sections
    resources :provider_sections do
       get 'get_section_data', on: :member
    end
    resources :employer_logos do
       get 'image', on: :member
    end
    resources :network_logos do
       get 'image', on: :member
    end
    resources :print, only: [:index] do
      collection do
        get :print_all_queued
      end
      member do
        get :generate_sample
        get :generate_print
        get :generate_mobile_display
        get :generate_full_page
        get :print_queued_by_employer
      end
    end
    # resources :print_data do
    #   collection do
    #     get 'generate_sample'
    #     get 'generate_print'
    #     get 'generate_mobile_display'
    #     get 'generate_full_page'
    #   end
    # end
    get 'plans/:id/get_plan_template', to: 'plans#get_plan_template'
  end
  # resources :employer_setup
  resources :employers do
    collection do
      post 'import'
      get 'refresh_employer_information'
      get 'refresh_employer_members_information'
    end
    namespace :id_card do
      resources :setup, only: [:index, :update, :destroy] do
        collection do
          get 'plans'
          patch 'update_plans'
          get 'field_exceptions'
          patch 'update_field_exceptions'
          get 'update_active_status'
        end
      end
    end
  end


  # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
  # Can be used by load balancers and uptime monitors to verify that the app is live.
  get "up" => "rails/health#show", as: :rails_health_check

  root "welcome#index"
end
