Constructor
new Staff(id, name, contact, address, bankDetails, role, accessopt, payrollopt, statusopt, shiftopt, performanceRatingopt, experienceopt, languagesSpokenopt)
Creates a new Staff member
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
id |
string | Unique identifier for the staff member. | ||
name |
string | full name of the staff member. | ||
contact |
string | contact details (phone/email). | ||
address |
string | Residential address of the staff member. | ||
bankDetails |
string | Bank details for payroll transactions. | ||
role |
string | Role of the staff member(must be one of `Staff.ROLES`). | ||
access |
Array.<string> |
<optional> |
[] | List of permission granted to the staff member. |
payroll |
number |
<optional> |
0 | Monthly salary of the staff member. |
status |
string |
<optional> |
Staff.STATUS.ACTIVE | employment status. |
shift |
string |
<optional> |
Staff.SHIFTS.MORNING | Work shift. |
performanceRating |
number |
<optional> |
0 | Performance rating (0 to 5). |
experience |
Array.<string> |
<optional> |
0 | Work experience in years. |
languagesSpoken |
Array.<string> |
<optional> |
[] | Languages spoken by the staff member. |
- Source:
Throws:
-
If an invalid role, status, shift,performance rating, or experience is provided.
- Type
- Erroe
Members
(readonly) ROLES :string
Enum for staff roles.
Type:
- string
- Source:
(readonly) SHIFTS :string
Enum for staff shift timings.
Type:
- string
- Source:
(readonly) STATUS :string
Enum for staff status.
Type:
- string
- Source:
Methods
addAccess(permission)
Grants a new access permission to the staff member.
Parameters:
| Name | Type | Description |
|---|---|---|
permission |
string | The permission to add. |
- Source:
getDetails() → {Object}
Retrieves staff member details.
- Source:
Returns:
The staff member's details.
- Type
- Object
removeAccess(permission)
Removes an access permission from the staff member.
Parameters:
| Name | Type | Description |
|---|---|---|
permission |
string | The permission to remove. |
- Source:
updateDetails(details)
Updates staff member details.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
details |
Object | The details to update.
Properties
|
- Source: