{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:folio:1:logs",
  "title": "logs.json",
  "description": "What was eaten. Only in full exports.",
  "type": "array",
  "items": {
    "type": "object",
    "required": [
      "id",
      "loggedAt",
      "date",
      "kind",
      "name",
      "kcal",
      "protein",
      "carbs",
      "fat"
    ],
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1
      },
      "loggedAt": {
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$",
        "description": "ISO 8601 in UTC with a Z, seconds required, fractions of a second optional (up to 9 digits): 2026-11-08T12:00:00Z."
      },
      "date": {
        "type": "string",
        "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
        "description": "A calendar day, yyyy-MM-dd, in the cook's own time zone."
      },
      "slotId": {
        "type": [
          "string",
          "null"
        ],
        "description": "Null for Other."
      },
      "kind": {
        "enum": [
          "recipe",
          "food",
          "quick"
        ]
      },
      "recipeId": {
        "type": [
          "string",
          "null"
        ]
      },
      "foodId": {
        "type": [
          "string",
          "null"
        ]
      },
      "name": {
        "type": "string"
      },
      "amount": {
        "type": "string",
        "description": "\"1 serving\", \"150 g\"."
      },
      "planEntryId": {
        "type": [
          "string",
          "null"
        ]
      },
      "kcal": {
        "type": "integer",
        "minimum": 0
      },
      "protein": {
        "type": "integer",
        "minimum": 0
      },
      "carbs": {
        "type": "integer",
        "minimum": 0
      },
      "fat": {
        "type": "integer",
        "minimum": 0
      }
    },
    "description": "A snapshot: it stays true after its recipe changes or goes."
  }
}
