{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oyster-hr/json-schema/oyster-hr-payments-group-schema.json",
  "title": "paymentsGroup",
  "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/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"
  ],
  "$defs": {
    "amount": {
      "type": "object",
      "properties": {
        "decimal": {
          "type": "string",
          "pattern": "^\\d+([.]\\d+)?$"
        },
        "currencyCode": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        }
      },
      "required": [
        "decimal",
        "currencyCode"
      ]
    }
  }
}