{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oyster-hr/json-schema/oyster-hr-expenses-schema.json",
  "title": "expenses",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oyster-hr-expenses-api-openapi.yml#/components/schemas/expenses",
  "type": "array",
  "items": {
    "$ref": "#/$defs/expense"
  },
  "$defs": {
    "amount": {
      "type": "object",
      "properties": {
        "decimal": {
          "type": "string",
          "pattern": "^\\d+([.]\\d+)?$"
        },
        "currencyCode": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        }
      },
      "required": [
        "decimal",
        "currencyCode"
      ]
    },
    "expense": {
      "type": "object",
      "properties": {
        "expenseId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "amount": {
          "type": "object",
          "$ref": "#/$defs/amount"
        },
        "category": {
          "type": "string",
          "pattern": "^[A-Z_]+$"
        },
        "incurredOn": {
          "type": "string",
          "format": "date"
        },
        "submittedAt": {
          "type": "string",
          "format": "date-time"
        },
        "reviewState": {
          "type": "string"
        },
        "reviewedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "receiptAmount": {
          "type": "object",
          "$ref": "#/$defs/amount"
        },
        "receiptUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "engagement": {
          "type": "object",
          "properties": {
            "engagementId": {
              "type": "string"
            },
            "name": {
              "type": [
                "string",
                "null"
              ]
            },
            "engagementType": {
              "type": "string",
              "pattern": "^[A-Z_]+$"
            }
          }
        },
        "source": {
          "type": "string"
        }
      },
      "required": [
        "expenseId",
        "name",
        "amount",
        "category",
        "receiptAmount"
      ]
    }
  }
}