@@ -15,6 +15,8 @@ defmodule Helix.Universe.Bank.Action.Flow.BankAccount do
1515
1616 alias Helix.Universe.Bank.Process.Bank.Account.RevealPassword ,
1717 as: BankAccountRevealPasswordProcess
18+ alias Helix.Universe.Bank.Process.Bank.Account.ChangePassword ,
19+ as: BankAccountChangePasswordProcess
1820
1921 @ typep relay :: Event . relay
2022
@@ -46,6 +48,19 @@ defmodule Helix.Universe.Bank.Action.Flow.BankAccount do
4648 BankAccountRevealPasswordProcess . execute ( gateway , atm , params , meta , relay )
4749 end
4850
51+ @ spec change_password ( BankAccount . t , Server . t , Server . t , relay ) ::
52+ { :ok , Process . t }
53+ | BankAccountChangePasswordProcess . executable_error
54+ def change_password ( account , gateway , atm , relay ) do
55+ meta = % {
56+ network_id: NetworkQuery . internet ( ) . network_id ,
57+ src_atm_id: atm . server_id ,
58+ src_acc_number: account . account_number ,
59+ bounce: nil
60+ }
61+
62+ BankAccountChangePasswordProcess . execute ( gateway , atm , % { } , meta , relay )
63+ end
4964 @ doc """
5065 Logs into a bank account using a password. If the given password matches the
5166 current account password, the login is successful, in which case a BankLogin
@@ -74,9 +89,9 @@ defmodule Helix.Universe.Bank.Action.Flow.BankAccount do
7489 { :ok , _ , events } <- BankAction . login_password ( acc , password , entity ) ,
7590 on_success ( fn -> Event . emit ( events ) end ) ,
7691
77- { :ok , _ , connection } <- start_connection . ( )
92+ { :ok , tunnel , connection } <- start_connection . ( )
7893 do
79- { :ok , connection }
94+ { :ok , tunnel , connection }
8095 end
8196 end
8297 end
0 commit comments