Skip to content

Commit

Permalink
Add transaction_expense_type column and update transaction_kind column
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Jan 18, 2024
1 parent 59156b6 commit a8ab02f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/collective.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ def sync_transactions
net_amount: node['netAmount']['value'],
transaction_type: node['type'],
transaction_kind: node['kind'],
transaction_expense_type: node['expense'] ? node['expense']['type'] : nil,
currency: node['amount']['currency'],
account: node['type'] == 'DEBIT' ? node['toAccount']['slug'] : node['fromAccount']['slug'],
created_at: node['createdAt'],
Expand Down Expand Up @@ -346,6 +347,10 @@ def fetch_transactions_from_graphql(offset: 0)
}
createdAt
type
kind
expense {
type
}
toAccount {
slug
}
Expand Down
1 change: 1 addition & 0 deletions db/migrate/20240118155013_add_kind_to_transactions.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class AddKindToTransactions < ActiveRecord::Migration[7.1]
def change
add_column :transactions, :transaction_kind, :string
add_column :transactions, :transaction_expense_type, :string
rename_column :transactions, :kind, :transaction_type
end
end
1 change: 1 addition & 0 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a8ab02f

Please sign in to comment.