-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathybs.go
54 lines (46 loc) · 1.13 KB
/
ybs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package ybs
import "time"
type Transaction struct {
Date time.Time
Description string
Amount float64
Status string
}
type BankAccount struct {
Name string
Number string
}
type Budget struct {
ID string
Name string
}
type BankService interface {
Login(UserInterface) error
Logout() error
Transactions(BankAccount, UserInterface) ([]Transaction, error)
}
type BudgetService interface {
Budgets() ([]Budget, error)
ChooseAccount(Budget, UserInterface) (BankAccount, error)
AppendTransactions(Budget, BankAccount, []Transaction) ([]Transaction, error)
}
type UserInterface interface {
Ask(string) (string, error)
Choose(string, []string) (string, error)
ChooseMultiple(string, []string) ([]string, error)
ShowQrCode(string) error
ShowTransactions([]Transaction) error
}
type Browser interface {
Get(string) error
ClickButton(string) error
ClickLink(string) error
ClickDiv(string) error
ClickDivByAttribute(string, string) error
TextField(string, string) error
ScanQrCode() (string, error)
Find(string, string) (bool, error)
Table(string) ([][]string, error)
DownloadDirectory() string
Close() error
}