{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oyster-hr/json-schema/oyster-hr-charge-details-schema.json",
  "title": "chargeDetails",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oyster-hr-payments-api-openapi.yml#/components/schemas/chargeDetails",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "NO_PAYMENT",
        "PENDING",
        "WAITING_FOR_WIRE_TRANSFER",
        "OVERDUE",
        "DIRECT_DEBIT_IN_PROGRESS",
        "DIRECT_DEBIT_FAILED",
        "CHARGED_BACK",
        "PAID",
        "PARTIALLY_PAID",
        "VOIDED"
      ]
    },
    "amount": {
      "$ref": "#/$defs/paymentsAmount"
    },
    "completedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "amountDue": {
      "$ref": "#/$defs/paymentsAmount"
    },
    "collectionType": {
      "type": "string",
      "enum": [
        "DIRECT_DEBIT",
        "WIRE_TRANSFER"
      ]
    },
    "subject": {
      "type": "object",
      "description": "The entity that is being charged.",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "type"
      ]
    }
  },
  "required": [
    "id",
    "status",
    "amount",
    "completedAt",
    "amountDue",
    "collectionType",
    "subject"
  ],
  "$defs": {
    "paymentsAmount": {
      "type": "object",
      "description": "Monetary amount with currency for payments.",
      "properties": {
        "decimal": {
          "type": "string",
          "pattern": "^\\d+([.]\\d+)?$"
        },
        "currencyCode": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        }
      },
      "required": [
        "decimal",
        "currencyCode"
      ]
    }
  }
}