Skip to content
This repository was archived by the owner on Jun 11, 2023. It is now read-only.

Commit 60c1b95

Browse files
Marcelo Amancio de Lima Santosthemaxhero
authored andcommitted
WIP
1 parent 08ec7eb commit 60c1b95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2271
-613
lines changed

src/Apps/Browser/Config.elm

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import Core.Flags as Core
66
import Utils.Core exposing (..)
77
import Apps.Params as AppParams exposing (AppParams)
88
import Game.Account.Database.Models exposing (HackedServers)
9-
import Game.Account.Finances.Requests.Login as LoginRequest
10-
import Game.Account.Finances.Requests.Transfer as TransferRequest
9+
import Game.Account.Finances.Models as Finances exposing (AccountNumber)
10+
import Game.Bank.Models as Bank
1111
import Game.Meta.Types.Desktop.Apps as DesktopApp exposing (DesktopApp)
1212
import Game.Meta.Types.Context exposing (Context(..))
13-
import Game.Meta.Types.Network as Network exposing (NIP)
13+
import Game.Meta.Types.Network as Network exposing (NIP, IP)
1414
import Game.Meta.Types.Desktop.Apps exposing (Reference, Requester)
1515
import Game.Servers.Models as Servers
1616
import Game.Servers.Shared as Servers exposing (CId)
@@ -37,6 +37,7 @@ type alias Config msg =
3737
, activeServer : ( CId, Servers.Server )
3838
, activeGateway : ( CId, Servers.Server )
3939
, hackedServers : HackedServers
40+
, bank : Bank.Model
4041
, onNewApp : DesktopApp -> Maybe Context -> Maybe AppParams -> CId -> msg
4142
, onOpenApp : AppParams -> CId -> msg
4243
, onSetContext : Context -> msg
@@ -45,18 +46,28 @@ type alias Config msg =
4546
, onSetEndpoint : Maybe CId -> msg
4647
, onNewPublicDownload : NIP -> Download.StorageId -> Filesystem.FileEntry -> msg
4748
, onNewBruteforceProcess : Network.IP -> msg
48-
, onBankAccountLogin : LoginRequest.Payload -> Requester -> msg
49-
, onBankAccountTransfer : TransferRequest.Payload -> Requester -> msg
49+
, onBankAccountLogin : Finances.AccountId -> String -> Requester -> msg
50+
, onBankAccountLoginToken : Finances.AccountId -> String -> Requester -> msg
51+
, onBankAccountChangePass : String -> Requester -> msg
52+
, onBankAccountCreate : Finances.AtmId -> Requester -> msg
53+
, onBankAccountClose : String -> Requester -> msg
54+
, onBankAccountLogout : String -> Requester -> msg
55+
, onBankResync : String -> Requester -> msg
56+
, onBankAccountTransfer : String -> IP -> AccountNumber -> Int -> Requester -> msg
5057
, menuAttr : ContextMenuAttribute msg
5158
}
5259

5360

5461
bankConfig : Config msg -> Bank.Config msg
5562
bankConfig config =
5663
{ toMsg = BankMsg >> ActiveTabMsg >> config.toMsg
57-
, onLogin = BankLogin >> config.toMsg
58-
, onTransfer = BankTransfer >> config.toMsg
59-
, onLogout = BankLogout |> config.toMsg
64+
, batchMsg = config.batchMsg
65+
, bank = config.bank
66+
, onLogin = BankLogin >>> config.toMsg
67+
, onLoginToken = BankLoginToken >>> config.toMsg
68+
, onTransfer = BankTransfer >>>>> config.toMsg
69+
, onChangePassword = BankChangePass >> config.toMsg
70+
, onLogout = BankLogout >> config.toMsg
6071
}
6172

6273

src/Apps/Browser/Messages.elm

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module Apps.Browser.Messages exposing (..)
22

3-
import Game.Account.Finances.Requests.Login as LoginRequest
4-
import Game.Account.Finances.Requests.Transfer as TransferRequest
5-
import Game.Meta.Types.Network as Network exposing (NIP)
3+
import Game.Account.Finances.Models as Finances
4+
import Game.Meta.Types.Network as Network exposing (NIP, IP)
65
import Game.Servers.Shared exposing (StorageId)
76
import Game.Servers.Filesystem.Shared as Filesystem
87
import Game.Servers.Requests.Browse as BrowseRequest
@@ -29,9 +28,11 @@ type Msg
2928
| ReqDownload Network.NIP Filesystem.FileEntry StorageId
3029
| PublicDownload NIP Filesystem.FileEntry
3130
| HandlePasswordAcquired PasswordAcquired.Data
32-
| BankLogin LoginRequest.Payload
33-
| BankTransfer TransferRequest.Payload
34-
| BankLogout
31+
| BankLogin Finances.AccountId String
32+
| BankLoginToken Finances.AccountId String
33+
| BankTransfer String IP Finances.AccountNumber Int
34+
| BankChangePass String
35+
| BankLogout String
3536

3637

3738
type TabMsg
@@ -44,8 +45,8 @@ type TabMsg
4445
| Cracked NIP String
4546
| AnyMap NIP
4647
| Login NIP String
47-
| HandleBankLogin LoginRequest.Data
48-
| HandleBankTransfer TransferRequest.Data
48+
| HandleBankLogin String
49+
| HandleBankTransfer String
4950
| HandleLoginFailed
5051
| SelectEndpoint
5152
| NewApp DesktopApp
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
module Apps.Browser.Pages.Bank.Config exposing (Config)
22

3-
import Game.Account.Finances.Requests.Login as LoginRequest
4-
import Game.Account.Finances.Requests.Transfer as TransferRequest
3+
import Game.Account.Finances.Models exposing (AccountId, AccountNumber)
4+
import Game.Bank.Models as Bank
5+
import Game.Meta.Types.Network exposing (IP)
56
import Apps.Browser.Pages.Bank.Messages exposing (..)
67

78

89
type alias Config msg =
910
{ toMsg : Msg -> msg
10-
, onLogin : LoginRequest.Payload -> msg
11-
, onTransfer : TransferRequest.Payload -> msg
12-
, onLogout : msg
11+
, batchMsg : List msg -> msg
12+
, bank : Bank.Model
13+
, onLogin : AccountId -> String -> msg
14+
, onLoginToken : AccountId -> String -> msg
15+
, onChangePassword : String -> msg
16+
, onTransfer : String -> IP -> AccountNumber -> Int -> msg
17+
, onLogout : String -> msg
1318
}

src/Apps/Browser/Pages/Bank/Messages.elm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module Apps.Browser.Pages.Bank.Messages exposing (Msg(..))
22

3-
import Game.Account.Finances.Shared exposing (BankAccountData)
4-
53

64
type Msg
7-
= HandleLogin BankAccountData
5+
= HandleLogin String
86
| HandleLoginError
9-
| HandleTransfer
7+
| SetTransfer
108
| HandleTransferError
9+
| SetLoading
10+
| Logout
1111
| UpdateLoginField String
1212
| UpdatePasswordField String
1313
| UpdateTransferBankField String

0 commit comments

Comments
 (0)