-
Notifications
You must be signed in to change notification settings - Fork 10
/
classes.js
45 lines (34 loc) · 1.12 KB
/
classes.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
var Contact = (function() {
"use strict";
function Contact(id, name, gender, company, email, phone, address) {
var argsArray = _.toArray(arguments);
validations.validateArgsLength(7, argsArray);
validations.validateContactArgs(argsArray);
this.id = id;
this.name = name;
this.gender = gender;
this.company = company;
this.email = email;
this.phone = phone;
this.address = address;
this.type = "contact";
}
return Contact;
}());
var Client = (function() {
"use strict";
function Client(id, name, gender, company, email, phone, address, registered, preferredBike, bikePoints, notes) {
var argsArray = _.toArray(arguments);
validations.validateArgsLength(11, argsArray);
validations.validateClientArgs(argsArray);
Contact.call(this, id, name, gender, company, email, phone, address);
this.type = 'client';
this.registered = registered;
this.preferredBike = preferredBike;
this.bikePoints = bikePoints;
this.notes = notes;
}
Client.prototype = Object.create(Contact.prototype);
Client.prototype.constructor = Client;
return Client;
}());