1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Account namespace updates: part 6 (transactions) (#904)

* Move Transaction to Account namespace

* Fix improper routes, improve separation of concerns

* Replace account transactions list partial with view

* Remove logs

* Consolidate transaction views

* Remove unused code

* Transfer style tweaks

* Remove more unused code

* Add back totals by currency helper
This commit is contained in:
Zach Gollwitzer 2024-06-24 11:58:39 -04:00 committed by GitHub
parent cb3fd34f90
commit da18c3d850
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
72 changed files with 575 additions and 522 deletions

50
db/schema.rb generated
View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.2].define(version: 2024_06_20_221801) do
ActiveRecord::Schema[7.2].define(version: 2024_06_21_212528) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
@ -32,6 +32,26 @@ ActiveRecord::Schema[7.2].define(version: 2024_06_20_221801) do
t.index ["account_id"], name: "index_account_balances_on_account_id"
end
create_table "account_transactions", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "name"
t.date "date", null: false
t.decimal "amount", precision: 19, scale: 4, null: false
t.string "currency", default: "USD", null: false
t.uuid "account_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.uuid "category_id"
t.boolean "excluded", default: false
t.text "notes"
t.uuid "merchant_id"
t.uuid "transfer_id"
t.boolean "marked_as_transfer", default: false, null: false
t.index ["account_id"], name: "index_account_transactions_on_account_id"
t.index ["category_id"], name: "index_account_transactions_on_category_id"
t.index ["merchant_id"], name: "index_account_transactions_on_merchant_id"
t.index ["transfer_id"], name: "index_account_transactions_on_transfer_id"
end
create_table "account_transfers", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
@ -309,26 +329,6 @@ ActiveRecord::Schema[7.2].define(version: 2024_06_20_221801) do
t.index ["family_id"], name: "index_tags_on_family_id"
end
create_table "transactions", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "name"
t.date "date", null: false
t.decimal "amount", precision: 19, scale: 4, null: false
t.string "currency", default: "USD", null: false
t.uuid "account_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.uuid "category_id"
t.boolean "excluded", default: false
t.text "notes"
t.uuid "merchant_id"
t.uuid "transfer_id"
t.boolean "marked_as_transfer", default: false, null: false
t.index ["account_id"], name: "index_transactions_on_account_id"
t.index ["category_id"], name: "index_transactions_on_category_id"
t.index ["merchant_id"], name: "index_transactions_on_merchant_id"
t.index ["transfer_id"], name: "index_transactions_on_transfer_id"
end
create_table "users", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.uuid "family_id", null: false
t.string "first_name"
@ -352,6 +352,10 @@ ActiveRecord::Schema[7.2].define(version: 2024_06_20_221801) do
end
add_foreign_key "account_balances", "accounts", on_delete: :cascade
add_foreign_key "account_transactions", "account_transfers", column: "transfer_id"
add_foreign_key "account_transactions", "accounts", on_delete: :cascade
add_foreign_key "account_transactions", "categories", on_delete: :nullify
add_foreign_key "account_transactions", "merchants"
add_foreign_key "account_valuations", "accounts", on_delete: :cascade
add_foreign_key "accounts", "families"
add_foreign_key "accounts", "institutions"
@ -363,9 +367,5 @@ ActiveRecord::Schema[7.2].define(version: 2024_06_20_221801) do
add_foreign_key "merchants", "families"
add_foreign_key "taggings", "tags"
add_foreign_key "tags", "families"
add_foreign_key "transactions", "account_transfers", column: "transfer_id"
add_foreign_key "transactions", "accounts", on_delete: :cascade
add_foreign_key "transactions", "categories", on_delete: :nullify
add_foreign_key "transactions", "merchants"
add_foreign_key "users", "families"
end