{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oyster-hr/json-schema/oyster-hr-payments-groups-schema.json",
  "title": "paymentsGroups",
  "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/paymentsGroups",
  "type": "array",
  "items": {
    "$ref": "#/$defs/paymentsGroup"
  },
  "$defs": {
    "amount": {
      "type": "object",
      "properties": {
        "decimal": {
          "type": "string",
          "pattern": "^\\d+([.]\\d+)?$"
        },
        "currencyCode": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        }
      },
      "required": [
        "decimal",
        "currencyCode"
      ]
    },
    "paymentsGroup": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "referenceCode": {
          "type": "string"
        },
        "itemsCount": {
          "type": "integer",
          "description": "The number of items included in this group."
        },
        "state": {
          "type": "string",
          "enum": [
            "PENDING",
            "WIRE_SENT",
            "PAID",
            "PROCESSING"
          ]
        },
        "amount": {
          "$ref": "#/$defs/amount"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time when the payments group was created."
        },
        "wireSentAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "The date and time when the wire transfer was sent."
        },
        "paidAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "The date and time when the payment was confirmed as received."
        }
      },
      "required": [
        "id",
        "referenceCode",
        "itemsCount",
        "state",
        "amount",
        "createdAt",
        "wireSentAt",
        "paidAt"
      ]
    }
  }
}