-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmployee.js
71 lines (65 loc) · 1.57 KB
/
Employee.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
const EnumEmployeeType = require('../enum/EnumEmployeeType');
/**
* Employee class is a base class for all employee types (Manager, Engineer, Intern)
* @class Employee
* @typedef {Employee}
* @property {string} name The name of the employee
* @property {number} id The id of the employee
* @property {string} email The email of the employee
* @property {EnumEmployeeType.EMPLOYEE} role The role of the employee
* @method getName Get the name of the employee
* @method getId Get the id of the employee
* @method getEmail Get the email of the employee
* @method getRole Get the role of the employee
* @instance Employee
*/
class Employee {
constructor(name, id, email) {
this.name = name;
this.id = id;
this.email = email;
this.role = EnumEmployeeType.EMPLOYEE;
}
/**
* Get the name of the employee
* @returns {string}
* @memberof Employee
* @method getName
* @instance Employee
*/
getName() {
return this.name;
}
/**
* Get the id of the employee
* @returns {number}
* @memberof Employee
* @method getId
* @instance Employee
*/
getId() {
return this.id;
}
/**
* Get the email of the employee
* @returns {string}
* @memberof Employee
* @method getEmail
* @instance Employee
*/
getEmail() {
return this.email;
}
/**
* Get the role of the employee
* @returns {EnumEmployeeType.EMPLOYEE}
* @throws {Error} If the employee type is invalid
* @memberof Employee
* @method getRole
* @instance Employee
*/
getRole() {
return this.role;
}
}
module.exports = Employee;