{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/permtracker-app/json-schema/permtracker-app-queue-schema.json",
  "title": "Queue",
  "description": "DOL's processing times and the pending PERM queue by filing month.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/permtracker-app-openapi.json#/components/schemas/Queue",
  "type": "object",
  "properties": {
    "perm": {
      "type": "object",
      "properties": {
        "asOf": {
          "description": "The day DOL's PERM processing times are dated.",
          "type": [
            "string",
            "null"
          ]
        },
        "decidingNow": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "month": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}$",
                  "description": "The filing month DOL is deciding, as YYYY-MM."
                },
                "asOf": {
                  "type": "string",
                  "description": "The day that reading was taken."
                },
                "source": {
                  "type": "string",
                  "description": "Where the reading comes from."
                }
              },
              "required": [
                "month",
                "asOf",
                "source"
              ],
              "additionalProperties": {}
            },
            {
              "type": "null"
            }
          ],
          "description": "The filing month DOL is deciding now, by PERM Tracker's daily check of case statuses. Null when it can't be read."
        },
        "oldestOpenMonth": {
          "description": "The oldest filing month that still has pending cases, as YYYY-MM.",
          "type": [
            "string",
            "null"
          ]
        },
        "queues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "queue": {
                "type": "string",
                "description": "The queue's name as DOL printed it, e.g. Analyst Review."
              },
              "workingOnMonth": {
                "description": "The filing month DOL printed for the queue, as YYYY-MM.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "asPrinted": {
                "description": "The same month in the words DOL printed.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "queue",
              "workingOnMonth",
              "asPrinted"
            ],
            "additionalProperties": {},
            "description": "One queue as DOL's processing times page printed it."
          },
          "description": "The months DOL printed for its PERM queues. Empty since October 31, 2026, when DOL stopped printing a PERM month: decidingNow gives the month by our own check."
        },
        "averageDays": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "determination": {
                "type": "string",
                "description": "The kind of determination, e.g. Analyst Review."
              },
              "month": {
                "description": "The month the average is for, when DOL gives one. Null when DOL gives a period.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "period": {
                "description": "The period the average covers, as DOL names it, e.g. Last 30 Days.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "calendarDays": {
                "type": "number",
                "description": "Average calendar days to a decision."
              }
            },
            "required": [
              "determination",
              "month",
              "calendarDays"
            ],
            "additionalProperties": {}
          },
          "description": "DOL's average days to a decision, by kind of determination."
        }
      },
      "required": [
        "asOf",
        "decidingNow",
        "oldestOpenMonth",
        "queues",
        "averageDays"
      ],
      "additionalProperties": {},
      "description": "PERM processing times."
    },
    "prevailingWage": {
      "type": "object",
      "properties": {
        "asOf": {
          "description": "The day DOL's prevailing wage processing times are dated.",
          "type": [
            "string",
            "null"
          ]
        },
        "queues": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "program": {
                "type": "string",
                "description": "The program the wage request is for, e.g. PERM, H-1B or CW-1."
              },
              "oewsReceiptDate": {
                "description": "The receipt month DOL is working on for requests using its OEWS wage survey, as YYYY-MM.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "nonOewsReceiptDate": {
                "description": "The same for requests using another wage source.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "program",
              "oewsReceiptDate",
              "nonOewsReceiptDate"
            ],
            "additionalProperties": {}
          },
          "description": "The receipt month DOL prints for each prevailing wage queue."
        },
        "permRequestsPending": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "receiptMonth": {
                    "type": "string",
                    "description": "The month the requests were received, as YYYY-MM."
                  },
                  "remainingRequests": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991,
                    "description": "PERM wage requests from that month still pending."
                  }
                },
                "required": [
                  "receiptMonth",
                  "remainingRequests"
                ],
                "additionalProperties": {}
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "Prevailing wage requests for PERM still pending, by the month DOL received them. Null when DOL's page can't be read."
        }
      },
      "required": [
        "asOf",
        "queues",
        "permRequestsPending"
      ],
      "additionalProperties": {},
      "description": "Prevailing wage processing times."
    },
    "pendingPermByFilingMonth": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "month": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}$",
                "description": "The filing month, as YYYY-MM."
              },
              "filed": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "PERM cases filed that month."
              },
              "decided": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "How many DOL has decided."
              },
              "pending": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "How many are still pending."
              },
              "inAnalystReview": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "How many of the pending are in analyst review."
              }
            },
            "required": [
              "month",
              "filed",
              "decided",
              "pending",
              "inAnalystReview"
            ],
            "additionalProperties": {}
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Pending PERM cases by filing month. Null when the count can't be read, never an empty list."
    }
  },
  "required": [
    "perm",
    "prevailingWage",
    "pendingPermByFilingMonth"
  ],
  "additionalProperties": {}
}