{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/remote-com/json-schema/remote-com-invoice-envelope-schema.json",
  "title": "InvoiceEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/remote-com-contractor-invoices-api-openapi.yml#/components/schemas/InvoiceEnvelope",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "contractor_invoice": {
          "$ref": "#/$defs/Invoice"
        }
      }
    }
  },
  "$defs": {
    "Invoice": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "employment_id": {
          "type": "string",
          "format": "uuid"
        },
        "amount": {
          "type": "integer",
          "description": "Amount in smallest currency unit."
        },
        "currency": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "submitted",
            "approved",
            "paid",
            "rejected",
            "void"
          ]
        },
        "period_start": {
          "type": "string",
          "format": "date"
        },
        "period_end": {
          "type": "string",
          "format": "date"
        },
        "issued_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}