-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
60 lines (50 loc) · 1.38 KB
/
main.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
55
56
57
58
59
60
package main
import (
"bengkelin/common"
c "bengkelin/features/customer"
cFunc "bengkelin/features/customer/functions"
cStruct "bengkelin/features/customer/structs"
s "bengkelin/features/sparepart"
sStruct "bengkelin/features/sparepart/structs"
t "bengkelin/features/transaction"
tStruct "bengkelin/features/transaction/structs"
"fmt"
)
func main() {
var transactions tStruct.ArrTransaction
var spareparts sStruct.ArrSparepart
var customers cStruct.ArrCustomer
var input string
// Reset View
common.ResetConsole()
// Dummy Data
common.CreateDummySparepart(&spareparts)
common.CreateDummyCustomer(&customers)
common.CreateDummyTransaction(&transactions)
// Inject View
// Menampilkan main menu
common.ShowMainMenu()
// Meminta input dari user untuk memilih menu
fmt.Print("→ Masukan kode menu : ")
fmt.Scan(&input)
for input != "0" {
// Mengecek ketersediaan menu
if input == "1" {
cFunc.SortCustomerById(&customers, "ASC")
t.Main(customers, &transactions, &spareparts)
common.ShowMainMenu()
} else if input == "2" {
s.Main(&spareparts)
common.ShowMainMenu()
} else if input == "3" {
c.Main(&customers)
common.ShowMainMenu()
} else {
fmt.Println("Yah menu ga tersedia nih 😩")
}
// Meminta input dari user untuk memilih menu
fmt.Print("→ Masukan kode menu : ")
fmt.Scan(&input)
}
fmt.Println("Berhasil keluar aplikasi 🥳")
}