Positions / Job Titles (المناصب)
Positions define job titles within departments, including grade levels and salary ranges.
Attributes
| Field | Type | Description |
|---|---|---|
id | integer | Primary key |
name_ar | string | Arabic name |
name_en | string | English name (nullable) |
code | string | Auto-generated code (POS-001) |
department_id | integer | Department FK (nullable) |
description | string | Description (nullable) |
grade | string | Grade level (nullable) |
min_salary | decimal | Minimum salary (nullable) |
max_salary | decimal | Maximum salary (nullable) |
status | string | active or inactive |
API Endpoints
| Method | URL | Description |
|---|---|---|
GET | /api/hr/positions | List positions (paginated) |
POST | /api/hr/positions | Create position |
GET | /api/hr/positions/{id} | Show position |
PUT | /api/hr/positions/{id} | Update position |
DELETE | /api/hr/positions/{id} | Delete position |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
department_id | integer | Filter by department |
status | string | Filter by active or inactive |
search | string | Search by name_ar, name_en, or code |
Examples
bash
# List positions in a department
curl -X GET "https://moon-erp.elbaset.com/api/hr/positions?department_id=1" \
-H "Authorization: Bearer {token}"
# Create position
curl -X POST "https://moon-erp.elbaset.com/api/hr/positions" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"name_ar": "محاسب",
"name_en": "Accountant",
"department_id": 1,
"grade": "B",
"min_salary": 5000,
"max_salary": 12000,
"status": "active"
}'dart
// List positions
final response = await dio.get('/api/hr/positions', queryParameters: {
'department_id': 1,
});
// Create position
final response = await dio.post('/api/hr/positions', data: {
'name_ar': 'محاسب',
'name_en': 'Accountant',
'department_id': 1,
'grade': 'B',
'min_salary': 5000,
'max_salary': 12000,
'status': 'active',
});Business Rules
- Position code is auto-generated via SequenceService
max_salarymust be >=min_salarywhen both are provided- Cannot delete a position that has active employees