Add model and views for bank accounts

This commit is contained in:
Patrick Gansterer 2018-09-14 19:33:27 +02:00
parent 4b1e9a6f53
commit f0a55fb951
24 changed files with 351 additions and 1 deletions

View file

@ -0,0 +1,25 @@
class CreateBankAccountsAndTransactions < ActiveRecord::Migration
def change
create_table :bank_accounts do |t|
t.string :name, null: false
t.string :iban
t.string :description
t.decimal :balance, precision: 12, scale: 2, default: 0, null: false
t.datetime :last_import
t.string :import_continuation_point
end
create_table :bank_transactions do |t|
t.references :bank_account, null: false
t.string :external_id
t.date :date
t.decimal :amount, precision: 8, scale: 2, null: false
t.string :iban
t.string :reference
t.text :text
t.text :receipt
t.binary :image, limit: 1.megabyte
t.references :financial_link, index: true
end
end
end

View file

@ -66,6 +66,30 @@ ActiveRecord::Schema.define(version: 20171111000000) do
add_index "assignments", ["user_id", "task_id"], name: "index_assignments_on_user_id_and_task_id", unique: true, using: :btree
create_table "bank_accounts", force: :cascade do |t|
t.string "name", null: false
t.string "iban"
t.string "description"
t.decimal "balance", precision: 12, scale: 2, default: 0, null: false
t.datetime "last_import"
t.string "import_continuation_point"
end
create_table "bank_transactions", force: :cascade do |t|
t.integer "bank_account_id", null: false
t.string "external_id"
t.date "date"
t.decimal "amount", precision: 8, scale: 2, null: false
t.string "iban"
t.string "reference"
t.text "text"
t.text "receipt"
t.binary "image"
t.integer "financial_link_id"
end
add_index "bank_transactions", ["financial_link_id"], name: "index_bank_transactions_on_financial_link_id", using: :btree
create_table "deliveries", force: :cascade do |t|
t.integer "supplier_id", limit: 4
t.date "delivered_on"