{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/taktovka-com/json-schema/taktovka-com-time-entry-schema.json",
  "title": "TimeEntry",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/taktovka-com-openapi.json#/components/schemas/TimeEntry",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "employee_id": {
      "type": "string",
      "format": "uuid"
    },
    "location_id": {
      "type": "string",
      "format": "uuid"
    },
    "shift_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "description": "The planned shift the entry belongs to; null for unplanned work"
    },
    "clock_in": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 instant with the location's offset at that moment"
    },
    "clock_out": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 instant with the location's offset at that moment"
        },
        {
          "type": "null"
        }
      ],
      "description": "null while the person is still in"
    },
    "source": {
      "type": "string",
      "enum": [
        "qr",
        "manual",
        "pos"
      ]
    },
    "offline_in": {
      "type": "boolean",
      "description": "The clock-in was read on a phone without signal and delivered later"
    },
    "offline_out": {
      "type": "boolean"
    },
    "corrected": {
      "type": "boolean",
      "description": "A manager entered or corrected the row"
    },
    "note": {
      "description": "Reason of the manual entry or the last correction",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "id",
    "employee_id",
    "location_id",
    "shift_id",
    "clock_in",
    "clock_out",
    "source",
    "offline_in",
    "offline_out",
    "corrected",
    "note"
  ],
  "additionalProperties": false
}