{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/akeda-ru/json-schema/akeda-ru-core-accounting-period-event-schema.json",
  "title": "CoreAccountingPeriodEvent",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/akeda-ru-core-accounting-api-openapi.yml#/components/schemas/CoreAccountingPeriodEvent",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "action",
    "closed_through",
    "actor_user_id",
    "actor_name",
    "happened_at",
    "reason",
    "forced",
    "warnings"
  ],
  "properties": {
    "id": {
      "$ref": "#/$defs/UUID"
    },
    "action": {
      "type": "string",
      "enum": [
        "close",
        "reopen"
      ]
    },
    "closed_through": {
      "type": "string",
      "description": "Empty means fully reopened"
    },
    "actor_user_id": {
      "type": "integer",
      "format": "int64"
    },
    "actor_name": {
      "type": "string"
    },
    "happened_at": {
      "type": "string",
      "format": "date-time"
    },
    "reason": {
      "type": "string"
    },
    "forced": {
      "type": "boolean",
      "description": "История: прежнее закрытие вопреки проверкам. Сейчас сервер сам проверяет период, и новое решение несёт false"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "История: предупреждения прежнего закрытия; у нового решения список пуст"
    }
  },
  "$defs": {
    "UUID": {
      "type": "string",
      "format": "uuid"
    }
  }
}