Job Offers (عروض العمل)
Create and send formal job offers to candidates. Accepted offers can trigger automatic employee creation.
Attributes
| Field | Type | Description |
|---|---|---|
id | integer | Primary key |
offer_number | string | Auto-generated number |
job_application_id | integer | Application FK |
candidate_id | integer | Candidate FK |
job_opening_id | integer | Job Opening FK |
position_id | integer | Position FK (nullable) |
department_id | integer | Department FK (nullable) |
offered_salary | decimal | Offered salary |
start_date | date | Proposed start date |
status | enum | draft, sent, accepted, rejected, expired, withdrawn |
notes | text | Additional notes (nullable) |
sent_at | datetime | When offer was sent (nullable) |
responded_at | datetime | When candidate responded (nullable) |
Status Workflow
API Endpoints
| Method | URL | Description |
|---|---|---|
GET | /api/hr/offers | List offers |
POST | /api/hr/offers | Create offer |
GET | /api/hr/offers/{id} | Show offer |
POST | /api/hr/offers/{id}/send | Send offer to candidate |
POST | /api/hr/offers/{id}/hire | Accept offer and create employee |
Examples
bash
# Create offer
curl -X POST "https://moon-erp.elbaset.com/api/hr/offers" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"job_application_id": 1,
"offered_salary": 7500,
"start_date": "2026-04-01",
"notes": "Includes 3-month probation period"
}'
# Send offer
curl -X POST "https://moon-erp.elbaset.com/api/hr/offers/1/send" \
-H "Authorization: Bearer {token}"
# Hire (accept + create employee)
curl -X POST "https://moon-erp.elbaset.com/api/hr/offers/1/hire" \
-H "Authorization: Bearer {token}"dart
final response = await dio.post('/api/hr/offers', data: {
'job_application_id': 1,
'offered_salary': 7500,
'start_date': '2026-04-01',
});
await dio.post('/api/hr/offers/1/send');
await dio.post('/api/hr/offers/1/hire');Business Rules
candidate_idandjob_opening_idare auto-populated from the linked application- Send marks the offer as sent and records the timestamp
- Hire accepts the offer, advances the application stage to
hired, creates a new employee record from the candidate data, and increments the job opening'sfilled_positions - Only one active (non-rejected/expired/withdrawn) offer per application