mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-23 07:09:39 +02:00
Scaffold out the UI for individual account page (#461)
* Add `AccountBalance` table for account views * Scaffold out account UI * Add D3 line chart scaffolding * Style fixes
This commit is contained in:
parent
0490fda465
commit
3ec9c9b56b
47 changed files with 724 additions and 12 deletions
14
db/migrate/20240212150110_create_account_balances.rb
Normal file
14
db/migrate/20240212150110_create_account_balances.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
class CreateAccountBalances < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :account_balances, id: :uuid do |t|
|
||||
t.references :account, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
|
||||
t.date :date, null: false
|
||||
t.decimal :balance, precision: 19, scale: 4, null: false
|
||||
t.string :currency, default: "USD", null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :account_balances, [ :account_id, :date ], unique: true
|
||||
end
|
||||
end
|
14
db/schema.rb
generated
14
db/schema.rb
generated
|
@ -10,11 +10,22 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 2024_02_10_155058) do
|
||||
ActiveRecord::Schema[7.2].define(version: 2024_02_12_150110) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pgcrypto"
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "account_balances", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.uuid "account_id", null: false
|
||||
t.date "date", null: false
|
||||
t.decimal "balance", precision: 19, scale: 4, null: false
|
||||
t.string "currency", default: "USD", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["account_id", "date"], name: "index_account_balances_on_account_id_and_date", unique: true
|
||||
t.index ["account_id"], name: "index_account_balances_on_account_id"
|
||||
end
|
||||
|
||||
create_table "account_credits", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
|
@ -195,6 +206,7 @@ ActiveRecord::Schema[7.2].define(version: 2024_02_10_155058) do
|
|||
t.index ["family_id"], name: "index_users_on_family_id"
|
||||
end
|
||||
|
||||
add_foreign_key "account_balances", "accounts", on_delete: :cascade
|
||||
add_foreign_key "accounts", "families"
|
||||
add_foreign_key "users", "families"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue