mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
* Feat(CoinStats): Scaffold implementation, not yet functional * Feat(CoinStats): Implement crypto wallet balance and transactions * Feat(CoinStats): Add tests, Minor improvements * Feat(CoinStats): Utilize bulk fetch API endpoints * Feat(CoinStats): Migrate strings to i8n * Feat(CoinStats): Fix error handling in wallet link modal * Feat(CoinStats): Implement hourly provider sync job * Feat(CoinStats): Generate docstrings * Fix(CoinStats): Validate API Key on provider update * Fix(Providers): Safely handle race condition in merchance creation * Fix(CoinStats): Don't catch system signals in account processor * Fix(CoinStats): Preload before iterating accounts * Fix(CoinStats): Add no opener / referrer to API dashboard link * Fix(CoinStats): Use strict matching for symbols * Fix(CoinStats): Remove dead code in transactions importer * Fix(CoinStats): Avoid transaction fallback ID collisions * Fix(CoinStats): Improve Blockchains fetch error handling * Fix(CoinStats): Enforce NOT NULL constraint for API Key schema * Fix(CoinStats): Migrate sync status strings to i8n * Fix(CoinStats): Use class name rather than hardcoded string * Fix(CoinStats): Use account currency rather than hardcoded USD * Fix(CoinStats): Migrate from standalone to Provider class * Fix(CoinStats): Fix test failures due to string changes
61 lines
1.7 KiB
Ruby
61 lines
1.7 KiB
Ruby
class CreateCoinstatsItemsAndAccounts < ActiveRecord::Migration[7.2]
|
|
def change
|
|
# Create provider items table (stores per-family connection credentials)
|
|
create_table :coinstats_items, id: :uuid do |t|
|
|
t.references :family, null: false, foreign_key: true, type: :uuid
|
|
t.string :name
|
|
|
|
# Institution metadata
|
|
t.string :institution_id
|
|
t.string :institution_name
|
|
t.string :institution_domain
|
|
t.string :institution_url
|
|
t.string :institution_color
|
|
|
|
# Status and lifecycle
|
|
t.string :status, default: "good"
|
|
t.boolean :scheduled_for_deletion, default: false
|
|
t.boolean :pending_account_setup, default: false
|
|
|
|
# Sync settings
|
|
t.datetime :sync_start_date
|
|
|
|
# Raw data storage
|
|
t.jsonb :raw_payload
|
|
t.jsonb :raw_institution_payload
|
|
|
|
# Provider-specific credential fields
|
|
t.string :api_key, null: false
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :coinstats_items, :status
|
|
|
|
# Create provider accounts table (stores individual account data from provider)
|
|
create_table :coinstats_accounts, id: :uuid do |t|
|
|
t.references :coinstats_item, null: false, foreign_key: true, type: :uuid
|
|
|
|
# Account identification
|
|
t.string :name
|
|
t.string :account_id
|
|
|
|
# Account details
|
|
t.string :currency
|
|
t.decimal :current_balance, precision: 19, scale: 4
|
|
t.string :account_status
|
|
t.string :account_type
|
|
t.string :provider
|
|
|
|
# Metadata and raw data
|
|
t.jsonb :institution_metadata
|
|
t.jsonb :raw_payload
|
|
t.jsonb :raw_transactions_payload
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :coinstats_accounts, :account_id
|
|
end
|
|
end
|