{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/acculynx/json-schema/acculynx-job-post-schema.json",
  "title": "jobPost",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acculynx-jobs-api-openapi.yml#/components/schemas/jobPost",
  "type": "object",
  "properties": {
    "contact": {
      "$ref": "#/$defs/contactId",
      "description": "The existing contact to link as the primary contact for this job. Required."
    },
    "leadSource": {
      "$ref": "#/$defs/leadSourcePost",
      "description": "The lead source that identifies how this job was originated."
    },
    "locationAddress": {
      "$ref": "#/$defs/jobAddressPost",
      "description": "The physical address of the job location."
    },
    "priority": {
      "$ref": "#/$defs/jobPriorityPost",
      "description": "The priority level for this job."
    },
    "jobCategory": {
      "$ref": "#/$defs/jobCategoryPost",
      "description": "The job category to assign to this job. Must reference a valid category configured in company settings."
    },
    "workType": {
      "$ref": "#/$defs/workTypePost",
      "description": "The work type to assign to this job. Must reference a valid work type configured in company settings."
    },
    "tradeTypes": {
      "type": "array",
      "description": "The trade types to assign to this job. Each entry must reference a valid trade type configured in company settings.",
      "items": {
        "$ref": "#/$defs/tradeTypePost"
      }
    },
    "notes": {
      "type": "string",
      "description": "A note or remark for this new job.",
      "maxLength": 1000
    }
  },
  "required": [
    "contact"
  ],
  "$defs": {
    "contactId": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The unique identifier of the contact."
        }
      },
      "required": [
        "id"
      ]
    },
    "jobAddressPost": {
      "type": "object",
      "properties": {
        "street1": {
          "type": "string",
          "description": "The primary street address line.",
          "maxLength": 250
        },
        "street2": {
          "type": "string",
          "description": "An optional secondary address line, such as a suite or unit number.",
          "maxLength": 50
        },
        "city": {
          "type": "string",
          "description": "The city name.",
          "maxLength": 50
        },
        "state": {
          "type": "string",
          "description": "The state or province code.",
          "maxLength": 50
        },
        "country": {
          "type": "string",
          "description": "The ISO 3166-1 alpha-2 country code.",
          "maxLength": 50
        },
        "zipCode": {
          "type": "string",
          "description": "The postal or ZIP code.",
          "maxLength": 50
        }
      },
      "required": [
        "street1",
        "city",
        "state",
        "country",
        "zipCode"
      ]
    },
    "jobCategoryPost": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The unique identifier of the job category."
        }
      }
    },
    "jobPriorityPost": {
      "type": "string",
      "enum": [
        "Urgent",
        "High",
        "Normal"
      ],
      "description": "The priority level for this job."
    },
    "leadSourcePost": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The unique identifier of the lead source."
        }
      },
      "required": [
        "id"
      ]
    },
    "tradeTypePost": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The trade type unique identifier."
        }
      }
    },
    "workTypePost": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The unique identifier of the work type."
        }
      }
    }
  }
}