{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/valjeanspecialty/json-schema/valjeanspecialty-invoice-list-schema.json",
  "title": "InvoiceList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/valjeanspecialty-invoices-api-openapi.yml#/components/schemas/InvoiceList",
  "type": "object",
  "properties": {
    "invoices": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Invoice"
      }
    }
  },
  "required": [
    "invoices"
  ],
  "$defs": {
    "Invoice": {
      "allOf": [
        {
          "$ref": "#/$defs/InvoiceSummary"
        },
        {
          "type": "object",
          "properties": {
            "policy_id": {
              "type": "string",
              "format": "uuid"
            },
            "policy_number": {
              "type": [
                "string",
                "null"
              ]
            },
            "insured": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "policy_id",
            "policy_number",
            "insured"
          ]
        }
      ]
    },
    "InvoiceSummary": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "invoice_number": {
          "type": "integer"
        },
        "issued_on": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "due_on": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "amount_due": {
          "type": "number"
        },
        "status": {
          "type": "string",
          "enum": [
            "sent",
            "paid",
            "overdue"
          ]
        },
        "paid_on": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        }
      },
      "required": [
        "id",
        "invoice_number",
        "issued_on",
        "due_on",
        "amount_due",
        "status",
        "paid_on"
      ]
    }
  }
}