Skip to content

Job Offers (عروض العمل)

Create and send formal job offers to candidates. Accepted offers can trigger automatic employee creation.

Attributes

FieldTypeDescription
idintegerPrimary key
offer_numberstringAuto-generated number
job_application_idintegerApplication FK
candidate_idintegerCandidate FK
job_opening_idintegerJob Opening FK
position_idintegerPosition FK (nullable)
department_idintegerDepartment FK (nullable)
offered_salarydecimalOffered salary
start_datedateProposed start date
statusenumdraft, sent, accepted, rejected, expired, withdrawn
notestextAdditional notes (nullable)
sent_atdatetimeWhen offer was sent (nullable)
responded_atdatetimeWhen candidate responded (nullable)

Status Workflow

API Endpoints

MethodURLDescription
GET/api/hr/offersList offers
POST/api/hr/offersCreate offer
GET/api/hr/offers/{id}Show offer
POST/api/hr/offers/{id}/sendSend offer to candidate
POST/api/hr/offers/{id}/hireAccept 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_id and job_opening_id are 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's filled_positions
  • Only one active (non-rejected/expired/withdrawn) offer per application

Moon ERP API Documentation