Each staff member can have multiple roles. A staff member can be a receptionist as well as a cashier.
Only Admin and Manager can add/update/delete staff members.
Constraints of creating staff members:
The full name field is mandatory to create a new staff member. The size of the name should be less than 250 characters.
Password is also a mandatory field. The maximum length of the password should not exceed more than 500 characters.
The phone number is a mandatory field as well. The phone number should also be unique. Two staff members cannot have the same phone number. Also, the pattern of the phone number should also match the mentioned format which is (503456789).
The given email should be a valid email address. Also, the staff member should have excess to that email as he/she needs to enter the OTP code which he/she will receive via email.
User roles are also mandatory. A staff member should have at least one role and can have as many roles as the system has.
Constraints of deleting staff members:
A staff member with an admin role cannot be deleted.
Constraints of updating staff members:
Full name is a mandatory field. Also, the size of the name should be less than 250 characters.
Phone number is a mandatory field as well. The pattern of the phone number should also match the mentioned format which is (503456789). Also, if the same phone number is already entered into the system, it will not be considered a valid phone number.
User roles are also mandatory. A staff member should have at least one role and can have as many roles as the system has.
Constraints of adding staff members:
Email address is a mandatory field. The given email should be a valid email address. Also, the email address should be unique.
User roles are also mandatory. A staff member should have at least one role and can have as many roles as the system has.