{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/permtracker-app/json-schema/permtracker-app-case-search-schema.json",
  "title": "CaseSearch",
  "description": "Cases found without a case number, with what DOL's record holds for the days read.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/permtracker-app-openapi.json#/components/schemas/CaseSearch",
  "type": "object",
  "properties": {
    "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."
    },
    "readBy": {
      "description": "How the search read: window (every case filed in the days read) or index (the employer's or firm's cases over any dates).",
      "type": "string"
    },
    "window": {
      "description": "The days read: from, to, and assumed when no date was sent with a job title alone."
    },
    "filed": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "The one filing day read, when the search was for a single day, as YYYY-MM-DD."
    },
    "period": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "filed": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Cases filed in the days read."
            },
            "decided": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "How many of them DOL has decided."
            },
            "waiting": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "How many are still waiting."
            }
          },
          "required": [
            "filed",
            "decided",
            "waiting"
          ],
          "additionalProperties": {},
          "description": "What DOL's record holds for the days read, whatever was asked."
        },
        {
          "type": "null"
        }
      ]
    },
    "day": {
      "description": "The same as period, under its older name. Sent for a single-day search.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "filed": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Cases filed in the days read."
            },
            "decided": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "How many of them DOL has decided."
            },
            "waiting": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "How many are still waiting."
            }
          },
          "required": [
            "filed",
            "decided",
            "waiting"
          ],
          "additionalProperties": {},
          "description": "What DOL's record holds for the days read, whatever was asked."
        },
        {
          "type": "null"
        }
      ]
    },
    "matchedEmployer": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ],
      "description": "Cases in the days read whose employer matched the name sent."
    },
    "matched": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Cases that matched everything sent."
    },
    "cases": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "caseNumber": {
            "type": "string",
            "description": "The case number as DOL prints it."
          },
          "status": {
            "description": "DOL's status for the case.",
            "type": [
              "string",
              "null"
            ]
          },
          "isFinal": {
            "type": "boolean",
            "description": "True once the case is decided or withdrawn."
          },
          "employer": {
            "description": "The employer's name as DOL holds it.",
            "type": [
              "string",
              "null"
            ]
          },
          "jobTitle": {
            "description": "The job title on the case.",
            "type": [
              "string",
              "null"
            ]
          },
          "filedOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "description": "The day the case was filed, as YYYY-MM-DD."
              },
              {
                "type": "null"
              }
            ]
          },
          "decisionDate": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "description": "The day DOL decided the case, as YYYY-MM-DD."
              },
              {
                "type": "null"
              }
            ]
          },
          "worksiteState": {
            "description": "The worksite's state, two letters, when DOL's record carries it.",
            "type": [
              "string",
              "null"
            ]
          },
          "wageRequest": {
            "description": "The case number of the prevailing wage request the case used, when DOL's record names one.",
            "type": [
              "string",
              "null"
            ]
          },
          "lawFirm": {
            "description": "The law firm on the case. DOL names it only once the case is decided.",
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "description": "The case's page on permtracker.app."
          }
        },
        "required": [
          "caseNumber",
          "status",
          "isFinal",
          "employer",
          "jobTitle",
          "decisionDate",
          "worksiteState",
          "wageRequest",
          "url"
        ],
        "additionalProperties": {},
        "description": "One case in a search answer."
      },
      "description": "The matching cases, 50 at most."
    },
    "truncated": {
      "type": "boolean",
      "description": "True when more cases matched than the answer lists."
    },
    "closeNames": {
      "type": "array",
      "items": {},
      "description": "With no employer fitting in a month or less: the employers that did file in those days under a close spelling."
    },
    "lawFirm": {
      "description": "The firm a law firm's words named, with the other firms they could mean.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "The firm's name as DOL's files print it."
            },
            "alternatives": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Other firms the same words could mean."
            }
          },
          "required": [
            "name",
            "alternatives"
          ],
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ]
    },
    "lawFirmUnknown": {
      "description": "True when a law firm was sent and no firm in the records matches it.",
      "type": "boolean"
    },
    "decidedOnly": {
      "description": "True when a law firm was sent: DOL names a firm only at the decision, so no pending case can be listed.",
      "type": "boolean"
    },
    "dayListCapped": {
      "type": "boolean",
      "description": "True when a read stopped at its limit, so a case can be missing from this answer."
    }
  },
  "required": [
    "program",
    "programName",
    "matchedEmployer",
    "matched",
    "cases",
    "truncated",
    "closeNames",
    "dayListCapped"
  ],
  "additionalProperties": {}
}