-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.js
43 lines (29 loc) · 1012 Bytes
/
index.js
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
// Driver file
var SplitWise = require('./SplitWise').SplitWise
var Display = require('./Display').Display
var {
EXPENSE_TYPE_EQUAL,
EXPENSE_TYPE_EXACT
} = require('./constant')
var app = new SplitWise()
var res = app.addUser("temp1", "[email protected]", 1234567890)
console.log(res)
var res = app.addUser("tmp2", "[email protected]", 2345678901)
console.log(res)
var res = app.addUser("temp3", "[email protected]", 3456789012)
console.log(res)
var res = app.addUser("temp3", "[email protected]", 4567890123)
console.log(res)
var res = app.addTransaction(1234567890, EXPENSE_TYPE_EQUAL, 100, [
2345678901, 3456789012, 4567890123
])
console.log(res)
var res = app.addTransaction(4567890123, EXPENSE_TYPE_EQUAL, 1000, [
2345678901, 1234567890, 3456789012
])
console.log(res)
var res = app.addTransaction(3456789012, EXPENSE_TYPE_EXACT, 100, [1234567890])
console.log(res)
Display.showUser(app.Users)
Display.showTransaction(app.Transactions)
Display.showUserTransaction(app.UserTransactions)