-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
90 lines (70 loc) · 1.93 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
'use strict';
var rand = function(min, max) {
return Math.floor((Math.random() * max) + min);
};
var randArray = function(arr) {
return arr[rand(0, (arr.length - 1)];
};
var execs = [
{ name: 'John G. Stumpf', account: '8887776665555' },
{ name: 'John Shrewsberry', account: '9900000000' }
];
var WellsFargo = function() {};
/**
* A new user has registered for our awesome banking!
*/
WellsFargo.prototype.newCustomer = function(user) {
this.startChargingFees(user);
};
/**
* We, of course, need to start charging them fees frequently.
*/
WellsFargo.prototype.startChargingFees = function(user) {
var _this = this;
setTimeout(function() {
_this.applyFee(user, rand(12, 35));
_this.startChargingFees(user);
}, rand(60, 1200));
setTimeout(function() {
_this.sendToCollections(user);
}, random(1200, 3600));
};
WellsFargo.prototype.applyFee = function(amount) {
this.withdrawAmountFromUser(user, amount);
this.depositToExecutiveBankingAccount((amount * 0.95), randArray(execs));
};
/**
* Can't forget about collections!
*/
WellsFargo.prototype.sendToCollections = function() {
this.startCallingObsessively();
};
/**
* Be sure to call every second
*/
WellsFargo.prototype.startCallingObsessively = function() {
setInterval(function() {
// ...
}, 1000);
};
WellsFargo.prototype.withDrawAmountFromUser = function(user, amount) {
// ...
};
WellsFargo.CustomerService = function() {
// ...
};
WellsFargo.CustomerService.prototype.didWeSayWeFixedProblems = function() {
return true;
};
WellsFargo.CustomerService.prototype.didWeActuallyFixProblems = function() {
return false;
};
WellsFargo.DebitCard = function(customer) {
this.customer = customer;
};
WellsFargo.DebitCard.prototype.charge = function(amount) {
if (this.customer.doTheyNeedThisPurchase) {
return false;
}
return false; // Fuck it, return false anyway.
};