Overview
The employee management system allows managers to create and manage user accounts for cashiers, inventory staff, and other managers. Each employee has a unique ID, secure PIN, and assigned role that determines their access permissions.Role-based access
Three roles: Manager, Cashier, and Inventory with distinct permissions
PIN authentication
Secure 6-digit PIN with SHA-256 hashing
User activity tracking
Complete audit trail of employee actions
Active/inactive status
Deactivate employees without deleting records
User roles
Manager
Full system access including:- Access POS for sales processing
- Apply discounts (no approval needed)
- Process returns and refunds
- View all reports and analytics
- Manage inventory (add/edit/delete products)
- Manage employees (create/edit/deactivate)
- Configure system settings
- View user activity logs
- Access hardware configuration
Cashier
Point-of-sale focused access:- Access POS for sales processing
- Request manager approval for discounts (if configured)
- Cannot process returns (manager only)
- Limited report access (own sales history)
- Cannot manage inventory
- Cannot manage employees
- Cannot change system settings
- Cannot view other user activity
Inventory
Inventory management focused access:- Access inventory management screen
- Add/edit/delete products
- Adjust stock quantities
- Cannot access POS
- Cannot process sales
- Cannot manage employees
- Limited report access (inventory reports)
Managing employees
Adding employees
Navigate to Employee Management
From the Manager dashboard, click “Employees” to access the employee management screen.
Fill in employee details
Enter required information:
- Name - Employee’s full name
- Employee ID - Unique identifier (e.g., “0001”, “CASH01”)
- PIN - 6-digit numeric PIN for authentication
- Role - Select from Manager, Cashier, or Inventory
- Name cannot be empty
- Employee ID must be unique
- PIN must be exactly 6 digits (0-9)
- Role must be one of: Manager, Cashier, Inventory
API endpoint
Create employee:POST /api/employees
Editing employees
Modify details
Update any field:
- Name
- Employee ID (must remain unique)
- PIN (displays as ”••••” for security)
- Role
- Name changes:
'John Smith' → 'John A. Smith' - Employee ID changes:
'0001' → '0002' - PIN updates:
"PIN updated"(actual PINs never logged) - Role changes:
'Cashier' → 'Manager' - Manager status:
false → true - Active status:
true → false
API endpoint
Update employee:PUT /api/employees/{id}
Deactivating employees
Reactivating: Click “Activate” button to restore access.
API endpoints
Deactivate:PUT /api/employees/{id}/deactivate
Activate: PUT /api/employees/{id}/activate
PIN management
PIN requirements
- Length: Exactly 6 digits
- Characters: Numeric only (0-9)
- Uniqueness: Not enforced (multiple employees can have same PIN, though not recommended)
- Security: Hashed with SHA-256 before storage
Setting PINs
During employee creation or editing:- Enter 6-digit PIN in PIN field
- PIN is displayed as entered (visible to manager)
- On save, PIN is hashed:
SHA256(pin) - Only hash is stored in database
Resetting PINs
Enter new PIN
Type new 6-digit PIN using on-screen keyboard.Note: The UI says “4-6 digits” but the backend enforces exactly 6 digits.
API endpoint
Reset PIN:PUT /api/employees/{id}/reset-pin
PUT /api/employees/{id}
PIN security
Hashing algorithm
PINs are hashed using SHA-256:PIN verification
During login:- User enters Employee ID and PIN
- System retrieves employee record
- User’s entered PIN is hashed
- Hashed value compared to stored hash
- If match, login succeeds
validateUserLogin(employeeId, pin)
Manager PIN validation
For discount approval and return authorization:- System prompts for manager PIN
- PIN is hashed and compared against all manager accounts
- If match found with
role === 'Manager', approval succeeds - Manager’s name is logged with the action
validateManagerPin(pin)
Security best practices
Employee list
Display format
Employees are shown in a vertical list with:- Name - Primary identifier
- Employee ID - Unique ID badge number
- Role - Manager/Cashier/Inventory
- Status - (Inactive) if not active
- Blue background + blue left border: Selected employee
- Gray text: Inactive employee
- Hover effect: Light gray background
Search and filtering
Search bar filters employees by:- Name (case-insensitive)
- Employee ID
- Role
API endpoint
List employees:GET /api/employees?includeInactive=true
Response:
Access control
Session management
When an employee logs in:- Credentials validated against database
- Session created in
SessionManager - Session includes:
- Employee ID
- Name
- Role
- Login timestamp
- Last activity timestamp
sessionStorage.setItem('currentUser', JSON.stringify(session))
Permission checking
Routes useSessionGuard component to enforce access:
requiredRole="Manager"- Managers onlyrequiredPermission="inventory.view"- Inventory or Manager- No restriction - All authenticated users
Auto-logout
Sessions expire after inactivity period (configured in System Settings):- Default: 15 minutes
- Extends by 5 minutes on business actions (completing sale)
- User redirected to login screen on expiration
- Session data cleared from storage
User activity tracking
All employee actions are logged:Tracked events
Employee management:CREATE- New employee createdUPDATE- Employee details modifiedDEACTIVATE- Employee deactivatedACTIVATE- Employee reactivatedPIN_RESET- PIN changed
CREATE- Product addedUPDATE- Product modifiedDELETE- Product deletedPRICE_CHANGE_MAJOR- Price changed >20%
SALE- Transaction completed
CREATE- Return processed
Activity log format
API endpoints
Complete employee management API:| Endpoint | Method | Purpose |
|---|---|---|
/api/employees | GET | List employees (with includeInactive param) |
/api/employees/{id} | GET | Get single employee |
/api/employees | POST | Create new employee |
/api/employees/{id} | PUT | Update employee |
/api/employees/{id}/deactivate | PUT | Deactivate employee |
/api/employees/{id}/activate | PUT | Reactivate employee |
/api/employees/{id}/reset-pin | PUT | Reset employee PIN |
Best practices
For managers
For managers
- Use descriptive Employee IDs (e.g., “CASH01”, “INV02”) for easy identification
- Never share PINs between employees
- Deactivate employees immediately on termination
- Review user activity logs weekly for unusual actions
- Rotate manager PINs monthly
- Assign minimum role required (principle of least privilege)
- Document role changes and reason in external records
For employees
For employees
- Memorize your PIN - don’t write it down
- Never share your PIN with coworkers
- Log out when leaving the POS terminal unattended
- Report forgotten PINs to manager immediately
- Notify manager if you suspect someone else used your account
For system administrators
For system administrators
- Back up employee database regularly
- Implement account lockout after 3-5 failed login attempts
- Add salt to PIN hashing algorithm before production
- Monitor user activity logs for security anomalies
- Set appropriate session timeout based on store traffic patterns
- Consider adding password complexity rules for high-security environments
Troubleshooting
Cannot create employee - Employee ID exists
Cannot create employee - Employee ID exists
Symptoms: Error “Employee ID already exists” when addingSolutions:
- Check employee list for duplicate Employee ID
- Include inactive employees in search (toggle checkbox)
- Choose a different Employee ID
- If truly duplicate, deactivate or delete old record
Employee cannot login
Employee cannot login
Symptoms: “Invalid credentials” error at login screenSolutions:
- Verify Employee ID is exactly as entered (case-sensitive)
- Confirm employee is active (not deactivated)
- Check PIN is exactly 6 digits
- Use Reset PIN to set a new PIN
- Verify employee record exists in database
Manager approval not working
Manager approval not working
Symptoms: Manager PIN rejected during discount approvalSolutions:
- Verify PIN belongs to user with Role = “Manager”
- Check manager account is active
- Confirm PIN is exactly 6 digits
- Test manager login directly to verify PIN works
- Check user activity logs for PIN reset history
PIN reset not saving
PIN reset not saving
Symptoms: New PIN doesn’t work after resetSolutions:
- Ensure new PIN is exactly 6 digits (not 4-6 as UI suggests)
- Wait a few seconds for database to update
- Refresh employee list to verify Last Updated timestamp
- Check browser console for JavaScript errors
- Try full employee update via Edit → Save instead
Related documentation
- User activity - View complete audit trail
- System settings - Configure session timeouts
- Sales processing - Manager discount approval
- Returns and refunds - Manager authorization