{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/permtracker-app/json-schema/permtracker-app-case-schema.json",
  "title": "Case",
  "description": "One DOL case: its status, dates, employer and job, DOL's decided record once there is one, and for a pending PERM case its place in the queue.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/permtracker-app-openapi.json#/components/schemas/Case",
  "type": "object",
  "properties": {
    "caseNumber": {
      "type": "string",
      "description": "The case number as DOL prints it, e.g. G-100-26045-123456."
    },
    "program": {
      "type": "string",
      "enum": [
        "perm",
        "pwd",
        "lca",
        "seasonal"
      ],
      "description": "Which DOL program the case belongs to: perm (PERM labor certification), pwd (prevailing wage request), lca (H-1B labor condition application) or seasonal (H-2A, H-2B or CW-1)."
    },
    "programName": {
      "type": "string",
      "description": "The program in words, e.g. PERM labor certification."
    },
    "status": {
      "description": "DOL's status for the case, as DOL prints it, e.g. ANALYST REVIEW or CERTIFIED. Null when no record carries one.",
      "type": [
        "string",
        "null"
      ]
    },
    "isFinal": {
      "type": "boolean",
      "description": "True once DOL has decided the case or the employer withdrew it."
    },
    "filingDate": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "The day the case was filed, as YYYY-MM-DD."
        },
        {
          "type": "null"
        }
      ]
    },
    "employer": {
      "description": "The employer's name as DOL holds it.",
      "type": [
        "string",
        "null"
      ]
    },
    "jobTitle": {
      "description": "The job title on the case.",
      "type": [
        "string",
        "null"
      ]
    },
    "statusCheckedOn": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "The day PERM Tracker last asked DOL about this case, as YYYY-MM-DD."
        },
        {
          "type": "null"
        }
      ]
    },
    "decision": {
      "anyOf": [
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ],
      "description": "DOL's decided record, once a disclosure file carries the case: status, receivedDate, decisionDate, and by program the occupation, worksite, wage and law firm. Null while the case is pending."
    },
    "accepted": {
      "description": "H-2A and H-2B only: the job as DOL accepted it (wage, workers, work period, worksite), before any decision.",
      "anyOf": [
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ]
    },
    "queue": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "filingMonth": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}$",
              "description": "The month the case was filed, as YYYY-MM."
            },
            "casesFiledThatMonth": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "PERM cases filed in that month."
            },
            "decidedFromThatMonth": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "How many of them DOL has decided."
            },
            "pendingFromThatMonth": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "How many of them are still pending."
            },
            "pendingFromEarlierMonths": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Pending PERM cases filed in earlier months, which DOL works first."
            }
          },
          "required": [
            "filingMonth",
            "casesFiledThatMonth",
            "decidedFromThatMonth",
            "pendingFromThatMonth",
            "pendingFromEarlierMonths"
          ],
          "additionalProperties": false,
          "description": "PERM only: where the case's filing month stands in DOL's queue."
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "caseNumber",
    "program",
    "programName",
    "status",
    "isFinal",
    "filingDate",
    "employer",
    "jobTitle",
    "statusCheckedOn",
    "decision",
    "queue"
  ],
  "additionalProperties": {}
}