Files
sure/app/models/enable_banking_item/sync_complete_event.rb
soky srm 4a29d030af Initial enable banking implementation (#382)
* Initial enable banking implementation

* Handle multiple connections

* Amount fixes

* Account type mapping

* Add option to skip accounts

* Update schema.rb

* Transaction fixes

* Provider fixes

* FIX account identifier

* FIX support unlinking

* UI style fixes

* FIX safe redirect and brakeman issue

* FIX

- pagination max fix
- wrap crud in transaction logic

* FIX api uid access

- The Enable Banking API expects the UUID (uid from the API response) to fetch balances/transactions, not the identification_hash

* FIX add new connection

* FIX erb code

* Alert/notice box overflow protection

* Give alert/notification boxes room to grow (3 lines max)

* Add "Enable Banking (beta)" to `/settings/bank_sync`

* Make Enable Banking section collapsible like all others

* Add callback hint to error message

---------

Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
2025-11-29 13:31:08 +01:00

26 lines
744 B
Ruby

class EnableBankingItem::SyncCompleteEvent
attr_reader :enable_banking_item
def initialize(enable_banking_item)
@enable_banking_item = enable_banking_item
end
def broadcast
# Update UI with latest account data
enable_banking_item.accounts.each do |account|
account.broadcast_sync_complete
end
# Update the Enable Banking item view
enable_banking_item.broadcast_replace_to(
enable_banking_item.family,
target: "enable_banking_item_#{enable_banking_item.id}",
partial: "enable_banking_items/enable_banking_item",
locals: { enable_banking_item: enable_banking_item }
)
# Let family handle sync notifications
enable_banking_item.family.broadcast_sync_complete
end
end