2025-03-19 12:36:16 -04:00
|
|
|
require "sidekiq/web"
|
|
|
|
|
2024-02-02 09:05:04 -06:00
|
|
|
Rails.application.routes.draw do
|
2025-02-06 14:16:53 -06:00
|
|
|
# MFA routes
|
|
|
|
resource :mfa, controller: "mfa", only: [ :new, :create ] do
|
|
|
|
get :verify
|
|
|
|
post :verify, to: "mfa#verify_code"
|
|
|
|
delete :disable
|
|
|
|
end
|
|
|
|
|
2025-03-19 12:36:16 -04:00
|
|
|
# Uses basic auth - see config/initializers/sidekiq.rb
|
|
|
|
mount Sidekiq::Web => "/sidekiq"
|
2024-10-24 17:28:29 -04:00
|
|
|
|
2024-10-03 14:42:22 -04:00
|
|
|
get "changelog", to: "pages#changelog"
|
|
|
|
get "feedback", to: "pages#feedback"
|
2024-10-09 13:17:58 -05:00
|
|
|
get "early-access", to: "pages#early_access"
|
2024-04-18 07:56:51 -04:00
|
|
|
|
2024-10-23 11:20:55 -04:00
|
|
|
resource :registration, only: %i[new create]
|
2024-10-03 14:42:22 -04:00
|
|
|
resources :sessions, only: %i[new create destroy]
|
2024-10-23 11:20:55 -04:00
|
|
|
resource :password_reset, only: %i[new create edit update]
|
|
|
|
resource :password, only: %i[edit update]
|
2025-01-31 11:29:49 -06:00
|
|
|
resource :email_confirmation, only: :new
|
2024-10-23 11:20:55 -04:00
|
|
|
|
2025-02-28 13:49:12 +01:00
|
|
|
resources :users, only: %i[update destroy] do
|
|
|
|
delete :reset, on: :member
|
|
|
|
end
|
2024-10-23 11:20:55 -04:00
|
|
|
|
|
|
|
resource :onboarding, only: :show do
|
|
|
|
collection do
|
|
|
|
get :profile
|
|
|
|
get :preferences
|
|
|
|
end
|
|
|
|
end
|
2024-04-13 09:28:45 -04:00
|
|
|
|
2024-04-18 07:56:51 -04:00
|
|
|
namespace :settings do
|
2025-01-30 13:13:37 -06:00
|
|
|
resource :profile, only: [ :show, :destroy ]
|
2024-10-23 11:20:55 -04:00
|
|
|
resource :preferences, only: :show
|
2025-02-28 13:49:12 +01:00
|
|
|
resource :hosting, only: %i[show update] do
|
|
|
|
delete :clear_cache, on: :collection
|
|
|
|
end
|
2024-10-08 14:37:47 -05:00
|
|
|
resource :billing, only: :show
|
2025-02-06 14:16:53 -06:00
|
|
|
resource :security, only: :show
|
2024-03-28 13:23:54 -04:00
|
|
|
end
|
|
|
|
|
2024-10-24 11:02:27 -04:00
|
|
|
resource :subscription, only: %i[new show] do
|
|
|
|
get :success, on: :collection
|
|
|
|
end
|
2024-10-08 14:37:47 -05:00
|
|
|
|
2024-10-24 11:02:27 -04:00
|
|
|
resources :tags, except: :show do
|
2024-08-23 10:06:24 -04:00
|
|
|
resources :deletions, only: %i[new create], module: :tag
|
2024-06-20 13:32:44 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
namespace :category do
|
|
|
|
resource :dropdown, only: :show
|
2024-05-23 08:09:33 -04:00
|
|
|
end
|
|
|
|
|
2025-01-16 14:36:37 -05:00
|
|
|
resources :categories, except: :show do
|
2024-08-23 10:06:24 -04:00
|
|
|
resources :deletions, only: %i[new create], module: :category
|
2024-12-20 11:37:26 -05:00
|
|
|
|
|
|
|
post :bootstrap, on: :collection
|
2024-06-20 08:15:09 -04:00
|
|
|
end
|
|
|
|
|
2025-02-21 11:57:59 -05:00
|
|
|
resources :budgets, only: %i[index show edit update], param: :month_year do
|
2025-01-16 14:36:37 -05:00
|
|
|
get :picker, on: :collection
|
|
|
|
|
|
|
|
resources :budget_categories, only: %i[index show update]
|
|
|
|
end
|
|
|
|
|
2024-08-23 10:06:24 -04:00
|
|
|
resources :merchants, only: %i[index new create edit update destroy]
|
2024-06-20 08:38:59 -04:00
|
|
|
|
2025-01-07 09:41:24 -05:00
|
|
|
resources :transfers, only: %i[new create destroy show update]
|
2024-06-19 06:52:08 -04:00
|
|
|
|
2024-10-01 10:47:59 -04:00
|
|
|
resources :imports, only: %i[index new show create destroy] do
|
2025-03-04 13:10:01 -05:00
|
|
|
member do
|
|
|
|
post :publish
|
|
|
|
put :revert
|
|
|
|
put :apply_template
|
|
|
|
end
|
2024-10-01 10:47:59 -04:00
|
|
|
|
|
|
|
resource :upload, only: %i[show update], module: :import
|
|
|
|
resource :configuration, only: %i[show update], module: :import
|
|
|
|
resource :clean, only: :show, module: :import
|
|
|
|
resource :confirm, only: :show, module: :import
|
|
|
|
|
|
|
|
resources :rows, only: %i[show update], module: :import
|
|
|
|
resources :mappings, only: :update, module: :import
|
|
|
|
end
|
|
|
|
|
2024-11-04 20:27:31 -05:00
|
|
|
resources :accounts, only: %i[index new] do
|
2024-06-20 07:26:25 -04:00
|
|
|
collection do
|
2024-07-05 13:36:18 +02:00
|
|
|
post :sync_all
|
2024-06-20 07:26:25 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
member do
|
|
|
|
post :sync
|
2024-11-27 16:01:50 -05:00
|
|
|
get :chart
|
2025-02-21 11:57:59 -05:00
|
|
|
get :sparkline
|
2024-06-20 07:26:25 -04:00
|
|
|
end
|
2024-11-27 16:01:50 -05:00
|
|
|
end
|
|
|
|
|
2025-02-21 11:57:59 -05:00
|
|
|
resources :accountable_sparklines, only: :show, param: :accountable_type
|
|
|
|
|
2024-11-27 16:01:50 -05:00
|
|
|
namespace :account do
|
|
|
|
resources :holdings, only: %i[index new show destroy]
|
2024-06-20 07:26:25 -04:00
|
|
|
|
2024-11-27 16:01:50 -05:00
|
|
|
resources :transactions, only: %i[show new create update destroy] do
|
2025-01-07 09:41:24 -05:00
|
|
|
resource :transfer_match, only: %i[new create]
|
2024-11-27 16:01:50 -05:00
|
|
|
resource :category, only: :update, controller: :transaction_categories
|
|
|
|
|
|
|
|
collection do
|
|
|
|
post "bulk_delete"
|
|
|
|
get "bulk_edit"
|
|
|
|
post "bulk_update"
|
|
|
|
post "mark_transfers"
|
|
|
|
post "unmark_transfers"
|
2024-10-28 15:49:19 -04:00
|
|
|
end
|
2024-11-27 16:01:50 -05:00
|
|
|
end
|
2024-08-09 11:22:57 -04:00
|
|
|
|
2024-11-27 16:01:50 -05:00
|
|
|
resources :valuations, only: %i[show new create update destroy]
|
|
|
|
resources :trades, only: %i[show new create update destroy]
|
|
|
|
end
|
|
|
|
|
|
|
|
direct :account_entry do |entry, options|
|
|
|
|
if entry.new_record?
|
|
|
|
route_for "account_#{entry.entryable_name.pluralize}", options
|
|
|
|
else
|
|
|
|
route_for entry.entryable_name, entry, options
|
2024-06-24 11:58:39 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2025-01-30 14:12:01 -05:00
|
|
|
resources :transactions, only: :index do
|
|
|
|
collection do
|
|
|
|
delete :clear_filter
|
|
|
|
end
|
|
|
|
end
|
2024-11-27 16:01:50 -05:00
|
|
|
|
2024-11-04 20:27:31 -05:00
|
|
|
# Convenience routes for polymorphic paths
|
|
|
|
# Example: account_path(Account.new(accountable: Depository.new)) => /depositories/123
|
|
|
|
direct :account do |model, options|
|
|
|
|
route_for model.accountable_name, model, options
|
|
|
|
end
|
|
|
|
direct :edit_account do |model, options|
|
|
|
|
route_for "edit_#{model.accountable_name}", model, options
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :depositories, except: :index
|
|
|
|
resources :investments, except: :index
|
|
|
|
resources :properties, except: :index
|
|
|
|
resources :vehicles, except: :index
|
|
|
|
resources :credit_cards, except: :index
|
|
|
|
resources :loans, except: :index
|
|
|
|
resources :cryptos, except: :index
|
|
|
|
resources :other_assets, except: :index
|
|
|
|
resources :other_liabilities, except: :index
|
2024-08-23 08:47:08 -04:00
|
|
|
|
2024-11-27 16:01:50 -05:00
|
|
|
resources :securities, only: :index
|
2024-02-02 09:05:04 -06:00
|
|
|
|
2024-09-11 19:04:39 +02:00
|
|
|
resources :invite_codes, only: %i[index create]
|
2024-06-13 14:37:27 -04:00
|
|
|
|
2025-01-30 13:13:37 -06:00
|
|
|
resources :invitations, only: [ :new, :create, :destroy ] do
|
2024-11-01 10:23:27 -05:00
|
|
|
get :accept, on: :member
|
|
|
|
end
|
|
|
|
|
2024-04-20 14:07:06 +02:00
|
|
|
resources :currencies, only: %i[show]
|
|
|
|
|
2024-10-18 11:26:58 -05:00
|
|
|
resources :impersonation_sessions, only: [ :create ] do
|
|
|
|
post :join, on: :collection
|
|
|
|
delete :leave, on: :collection
|
|
|
|
|
|
|
|
member do
|
|
|
|
put :approve
|
|
|
|
put :reject
|
|
|
|
put :complete
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2024-11-15 13:49:37 -05:00
|
|
|
resources :plaid_items, only: %i[create destroy] do
|
2025-02-12 12:59:35 -06:00
|
|
|
member do
|
|
|
|
post :sync
|
|
|
|
end
|
2024-11-15 13:49:37 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
namespace :webhooks do
|
|
|
|
post "plaid"
|
2025-02-07 10:35:42 -05:00
|
|
|
post "plaid_eu"
|
2024-11-15 13:49:37 -05:00
|
|
|
post "stripe"
|
|
|
|
end
|
2024-10-08 14:37:47 -05:00
|
|
|
|
2024-02-02 09:05:04 -06:00
|
|
|
# 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
|
|
|
|
|
|
|
|
# Render dynamic PWA files from app/views/pwa/*
|
|
|
|
get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
|
|
|
|
get "manifest" => "rails/pwa#manifest", as: :pwa_manifest
|
|
|
|
|
|
|
|
# Defines the root path route ("/")
|
|
|
|
root "pages#dashboard"
|
|
|
|
end
|