{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://api.horizon360.toro.com/schemas/job",
  "title": "Job",
  "description": "A landscaping job or work order in Toro Horizon360",
  "type": "object",
  "required": ["id", "customerId", "title", "jobType", "status"],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique job identifier"
    },
    "customerId": {
      "type": "string",
      "description": "Reference to the associated customer"
    },
    "title": {
      "type": "string",
      "description": "Job title or name"
    },
    "description": {
      "type": "string",
      "description": "Detailed job description"
    },
    "status": {
      "type": "string",
      "enum": ["pending", "scheduled", "in_progress", "completed", "invoiced"],
      "description": "Current job status"
    },
    "jobType": {
      "type": "string",
      "description": "Type of landscaping service (mowing, irrigation, planting, etc.)"
    },
    "serviceAddress": {
      "type": "object",
      "description": "Address where the work will be performed",
      "properties": {
        "street": {"type": "string"},
        "city": {"type": "string"},
        "state": {"type": "string"},
        "zip": {"type": "string"}
      }
    },
    "estimatedHours": {
      "type": "number",
      "minimum": 0,
      "description": "Estimated hours to complete the job"
    },
    "actualHours": {
      "type": "number",
      "minimum": 0,
      "description": "Actual hours spent on the job"
    },
    "scheduledDate": {
      "type": "string",
      "format": "date",
      "description": "Date the job is scheduled to be performed"
    },
    "completedDate": {
      "type": "string",
      "format": "date",
      "description": "Date the job was completed"
    },
    "crewId": {
      "type": "string",
      "description": "ID of the assigned crew"
    },
    "notes": {
      "type": "string",
      "description": "Additional job notes"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}
