@@ -3,6 +3,7 @@ defmodule Helix.Universe.Bank.Action.Flow.BankAccount do
33 import HELF.Flow
44
55 alias Helix.Event
6+ alias Helix.Entity.Model.Entity
67 alias Helix.Entity.Query.Entity , as: EntityQuery
78 alias Helix.Network.Action.Flow.Tunnel , as: TunnelFlow
89 alias Helix.Network.Query.Network , as: NetworkQuery
@@ -15,6 +16,8 @@ defmodule Helix.Universe.Bank.Action.Flow.BankAccount do
1516
1617 alias Helix.Universe.Bank.Process.Bank.Account.AccountCreate ,
1718 as: BankAccountCreateProcess
19+ alias Helix.Universe.Bank.Process.Bank.Account.AccountClose ,
20+ as: BankAccountCloseProcess
1821 alias Helix.Universe.Bank.Process.Bank.Account.RevealPassword ,
1922 as: BankAccountRevealPasswordProcess
2023 alias Helix.Universe.Bank.Process.Bank.Account.ChangePassword ,
@@ -62,29 +65,36 @@ defmodule Helix.Universe.Bank.Action.Flow.BankAccount do
6265 Starts the `bank_account_create` process.
6366 """
6467 def open ( gateway , account_id , atm , relay ) do
65- entity_id = Entity.ID . cast! ( to_string ( account_id . id ) )
68+ entity_id = Entity.ID . cast! ( to_string ( account_id ) )
69+ atm_id = atm . server_id
6670
6771 meta = % {
68- src_atm_id: atm . server_id ,
72+ network_id: NetworkQuery . internet ( ) . network_id ,
73+ bounce: nil ,
6974 source_entity_id: entity_id
7075 }
7176
72- BankAccountCreateProcess . execute ( gateway , atm , % { } , meta , relay )
77+ BankAccountCreateProcess . execute ( gateway , atm , % { atm_id: atm_id } , meta , relay )
7378 end
7479
75- @ spec close ( BankAccount . t ) ::
80+ @ spec close ( Server . t , BankAccount . t , Server . t , relay ) ::
7681 { :ok , Process . t }
7782 | BankAccountCloseProcess . executable_error
7883 @ doc """
7984 Starts the `bank_account_close` process.
8085 """
8186 def close ( gateway , bank_account , atm , relay ) do
8287 meta = % {
83- src_atm_id: bank_account . server_id ,
84- src_account_number: bank_account . account_number
88+ network_id: NetworkQuery . internet ( ) . network_id ,
89+ bounce: nil
90+ }
91+
92+ params = % {
93+ atm_id: bank_account . atm_id ,
94+ account_number: bank_account . account_number
8595 }
8696
87- BankAccountCloseProcess . execute ( gateway , atm , % { } , meta , relay )
97+ BankAccountCloseProcess . execute ( gateway , atm , params , meta , relay )
8898 end
8999
90100 @ spec change_password ( BankAccount . t , Server . t , Server . t , relay ) ::
0 commit comments