{
  "$schema": "https://abhcr.github.io/comcom-protocol/releases/v0.2.0/schemas/comcom-meta.schema.json",
  "$id": "https://abhcr.github.io/comcom-protocol/releases/v0.2.0/profiles/v0.2/identity.workforce/comcom-job-publish/schemas/input.schema.json",
  "title": "Job Publish input",
  "description": "Publish job using an exact, schema-validated Comcom interaction.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "capability",
    "parameters"
  ],
  "properties": {
    "capability": {
      "const": "comcom.job.publish"
    },
    "parameters": {
      "type": "object",
      "description": "Job Publish parameters.",
      "additionalProperties": false,
      "required": [
        "job"
      ],
      "properties": {
        "job": {
          "type": "object",
          "description": "Typed Job data.",
          "additionalProperties": false,
          "required": [
            "personId",
            "organizationId",
            "roleCode"
          ],
          "properties": {
            "statusCode": {
              "type": "string",
              "description": "Profile-defined business state.",
              "pattern": "^[a-z][a-zA-Z0-9.-]{0,63}$"
            },
            "personId": {
              "type": "string",
              "description": "Person URI.",
              "format": "uri-reference"
            },
            "organizationId": {
              "type": "string",
              "description": "Organization URI.",
              "format": "uri-reference"
            },
            "roleCode": {
              "type": "string",
              "description": "Job or role code.",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
            },
            "start": {
              "type": "string",
              "description": "Employment or assignment start.",
              "format": "date-time"
            },
            "end": {
              "type": "string",
              "description": "Employment or assignment end.",
              "format": "date-time"
            },
            "locationId": {
              "type": "string",
              "description": "Work location URI.",
              "format": "uri-reference"
            },
            "summary": {
              "type": "string",
              "description": "Role or request summary.",
              "maxLength": 2000
            }
          }
        },
        "requestedAt": {
          "type": "string",
          "description": "Requested effective instant.",
          "format": "date-time"
        }
      }
    }
  }
}
