{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/permtracker-app/json-schema/permtracker-app-entity-schema.json",
  "title": "Entity",
  "description": "One employer's, law firm's or occupation's PERM record, with its cases pending at DOL now.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/permtracker-app-openapi.json#/components/schemas/Entity",
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "employer",
        "attorney",
        "occupation"
      ],
      "description": "What the record is: an employer, a law firm (attorney) or an occupation."
    },
    "slug": {
      "type": "string",
      "description": "The record's name in its page's address. Send it to the matching get endpoint."
    },
    "name": {
      "type": "string",
      "description": "The name as DOL's files print it most often."
    },
    "rankByVolume": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ],
      "description": "Its rank by number of PERM cases, 1 being the most."
    },
    "publishedCases": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "PERM cases in DOL's published files: decided ones, so certified, denied or withdrawn."
    },
    "certified": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "How many were certified."
    },
    "denied": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "How many were denied."
    },
    "certifiedShare": {
      "description": "certified / (certified + denied), from 0 to 1. Null under the site's floor of decided cases.",
      "type": [
        "number",
        "null"
      ]
    },
    "medianDaysToDecision": {
      "description": "Median days from filing to decision.",
      "type": [
        "number",
        "null"
      ]
    },
    "filingsLast12Months": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ],
      "description": "PERM cases filed in the last 12 months."
    },
    "state": {
      "description": "Law firms only: the firm's state, two letters.",
      "type": [
        "string",
        "null"
      ]
    },
    "occupationCode": {
      "description": "Occupations only: the SOC code, e.g. 15-1252.",
      "type": [
        "string",
        "null"
      ]
    },
    "medianAnnualWage": {
      "description": "Occupations only: the median offered wage, a year, in dollars.",
      "type": [
        "number",
        "null"
      ]
    },
    "url": {
      "type": "string",
      "description": "The record's page on permtracker.app."
    },
    "pendingNow": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "pending": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Its cases pending at DOL now."
            },
            "casesTracked": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Its cases in DOL's live record, pending and decided."
            },
            "byStatus": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "A DOL status, as DOL prints it."
                  },
                  "cases": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "Its pending cases in that status."
                  }
                },
                "required": [
                  "status",
                  "cases"
                ],
                "additionalProperties": {}
              },
              "description": "The pending cases by DOL status."
            },
            "oldestPendingFiled": {
              "description": "The filing day of its oldest pending case.",
              "type": [
                "string",
                "null"
              ]
            },
            "asOf": {
              "description": "The day the live record was read.",
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "pending",
            "casesTracked",
            "byStatus",
            "oldestPendingFiled",
            "asOf"
          ],
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ],
      "description": "Its cases pending at DOL right now, by stage. Null when the live record can't be read."
    }
  },
  "required": [
    "kind",
    "slug",
    "name",
    "rankByVolume",
    "publishedCases",
    "certified",
    "denied",
    "certifiedShare",
    "medianDaysToDecision",
    "filingsLast12Months",
    "url",
    "pendingNow"
  ],
  "additionalProperties": {}
}