SHAR Production
← Все контракты

JSON Schema 2020-12

Журнал согласований

Этапы с timestamp и явными решениями.

Схема

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sharprod.com/schemas/approval-event-log.schema.json",
  "title": "SHAR Production Approval Event Log Contract",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "subject_id": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "at",
          "stage",
          "decision"
        ],
        "properties": {
          "at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
          },
          "stage": {
            "enum": [
              "brief",
              "creative",
              "offline",
              "master"
            ]
          },
          "decision": {
            "enum": [
              "approved",
              "changes_requested",
              "rejected"
            ]
          }
        }
      }
    }
  },
  "required": [
    "subject_id",
    "events"
  ]
}

Проверенный пример

{
  "input": {
    "subject_id": "synthetic-master",
    "events": [
      {
        "at": "2026-09-06T10:00:00Z",
        "stage": "master",
        "decision": "approved"
      }
    ]
  },
  "result": {
    "valid": true,
    "errors": []
  }
}

Отклонённый пример

{
  "input": {
    "subject_id": "synthetic-master",
    "events": [
      {
        "at": "today",
        "stage": "master",
        "decision": "yes"
      }
    ]
  },
  "result": {
    "valid": false,
    "errors": [
      {
        "instancePath": "/events/0/at",
        "schemaPath": "#/properties/events/items/properties/at/pattern",
        "keyword": "pattern",
        "params": {
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
        },
        "message": "must match pattern \"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$\""
      }
    ]
  }
}

SHAR Production · sharprod.com