Skip to content

Job Openings (فرص العمل)

Post job vacancies linked to departments and positions, track the number of positions to fill, and manage opening lifecycle.

Attributes

FieldTypeDescription
idintegerPrimary key
opening_numberstringAuto-generated number
title_enstringEnglish title
title_arstringArabic title
department_idintegerDepartment FK (nullable)
position_idintegerPosition FK (nullable)
branch_idintegerBranch FK (nullable)
number_of_positionsintegerPositions to fill
filled_positionsintegerPositions filled so far
statusenumdraft, open, on_hold, closed, filled
descriptiontextJob description (nullable)
requirementstextJob requirements (nullable)
employment_typestringFull-time, part-time, etc.
experience_years_minintegerMin experience (nullable)
experience_years_maxintegerMax experience (nullable)
salary_range_mindecimalMin salary (nullable)
salary_range_maxdecimalMax salary (nullable)
published_atdatetimePublication date (nullable)
closing_datedateApplication deadline (nullable)

Status Workflow

API Endpoints

MethodURLDescription
GET/api/hr/job-openingsList openings
POST/api/hr/job-openingsCreate opening
GET/api/hr/job-openings/{id}Show opening
PUT/api/hr/job-openings/{id}Update opening
DELETE/api/hr/job-openings/{id}Delete opening
POST/api/hr/job-openings/{id}/statusChange status

Examples

bash
# Create job opening
curl -X POST "https://moon-erp.elbaset.com/api/hr/job-openings" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "title_ar": "مطور برمجيات",
    "title_en": "Software Developer",
    "department_id": 2,
    "position_id": 5,
    "number_of_positions": 3,
    "employment_type": "permanent",
    "experience_years_min": 2,
    "salary_range_min": 5000,
    "salary_range_max": 8000,
    "closing_date": "2026-04-30"
  }'

# Update status
curl -X POST "https://moon-erp.elbaset.com/api/hr/job-openings/1/status" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{ "status": "open" }'
dart
final response = await dio.post('/api/hr/job-openings', data: {
  'title_ar': 'مطور برمجيات',
  'title_en': 'Software Developer',
  'department_id': 2,
  'number_of_positions': 3,
  'employment_type': 'permanent',
});

Business Rules

  • filled_positions is auto-incremented when a candidate is hired through this opening
  • Status transitions to filled automatically when filled_positions >= number_of_positions
  • Deleting an opening is only allowed when status is draft

Moon ERP API Documentation