Class: Staff

Staff(id, name, contact, address, bankDetails, role, accessopt, payrollopt, statusopt, shiftopt, performanceRatingopt, experienceopt, languagesSpokenopt)

Represent a staff member in the restaurant system.

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
Name Type Attributes Description
name string <optional>
Updated name.
contact string <optional>
Updated contact information.
address string <optional>
Updated address.
bankDetails string <optional>
Updated bank details.
role string <optional>
Updated role (must be a valid Staff.ROLES value).
access Array.<string> <optional>
Updated access permissions.
payroll number <optional>
Updated payroll amount.
status string <optional>
Updated status (must be a valid Staff.STATUS value).
shift string <optional>
Updated shift (must be a valid Staff.SHIFTS value).
performanceRating number <optional>
Updated performance rating (0 to 5).
experience number <optional>
Updated experience in years.
languagesSpoken Array.<string> <optional>
Updated languages spoken.
Source: