1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00

Account Sync should happen at login, 1x per day, OR on-demand (#594)

* Add last_sync_date to accounts table

* Always sync Account after Valuation or Transaction creation, update, or deletion.

Skip sync if user clicks "sync" button without changing anything

* Sync user accounts daily based on last_login_at
This commit is contained in:
Mattia 2024-04-04 23:00:12 +02:00 committed by GitHub
parent 4f0b2de4ef
commit 315c4bf1ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 48 additions and 8 deletions

4
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_03_25_064211) do
ActiveRecord::Schema[7.2].define(version: 2024_04_03_192649) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
@ -90,6 +90,7 @@ ActiveRecord::Schema[7.2].define(version: 2024_03_25_064211) do
t.enum "status", default: "ok", null: false, enum_type: "account_status"
t.jsonb "sync_warnings", default: "[]", null: false
t.jsonb "sync_errors", default: "[]", null: false
t.date "last_sync_date"
t.index ["accountable_type"], name: "index_accounts_on_accountable_type"
t.index ["family_id"], name: "index_accounts_on_family_id"
end
@ -232,6 +233,7 @@ ActiveRecord::Schema[7.2].define(version: 2024_03_25_064211) do
t.string "password_digest"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "last_login_at"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["family_id"], name: "index_users_on_family_id"
end