KPIs (مؤشرات الأداء)
Define Key Performance Indicators used in employee performance reviews. KPIs are grouped by category and assigned weights.
Attributes
| Field | Type | Description |
|---|---|---|
id | integer | Primary key |
name_en | string | English name |
name_ar | string | Arabic name (nullable) |
category | enum | quality, productivity, attendance, teamwork, leadership, communication |
description | text | KPI description (nullable) |
weight | decimal | Weight in review (0-100) |
is_active | boolean | Active status |
API Endpoints
| Method | URL | Description |
|---|---|---|
GET | /api/hr/kpis | List KPIs |
POST | /api/hr/kpis | Create KPI |
GET | /api/hr/kpis/{id} | Show KPI |
PUT | /api/hr/kpis/{id} | Update KPI |
DELETE | /api/hr/kpis/{id} | Delete KPI |
Examples
bash
curl -X POST "https://moon-erp.elbaset.com/api/hr/kpis" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"name_ar": "جودة العمل",
"name_en": "Work Quality",
"category": "quality",
"weight": 30,
"description": "Quality and accuracy of delivered work"
}'dart
final response = await dio.post('/api/hr/kpis', data: {
'name_ar': 'جودة العمل',
'name_en': 'Work Quality',
'category': 'quality',
'weight': 30,
});Business Rules
- KPIs are referenced by Review Templates via
kpi_idsJSON array - Weights are used to calculate weighted average scores in performance reviews
- Cannot delete a KPI that is referenced by active review templates