{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/flowral-app/json-schema/flowral-app-notification-digest-schema.json",
  "title": "NotificationDigest",
  "description": "One person's day: what is on them, what is free to pick up, what moved. Spans every flow they can see, including flows shared with them from workspaces they are not a member of.",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/flowral-app-openapi.json#/components/schemas/NotificationDigest",
  "type": "object",
  "properties": {
    "memberId": {
      "type": "string"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "When this was built."
    },
    "wouldSend": {
      "type": "boolean",
      "description": "False when there is nothing worth mailing — an empty digest is never sent."
    },
    "counts": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      },
      "description": "Totals BEFORE the per-section caps, so a truncated list still reports honestly."
    },
    "ready": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "questId": {
            "type": "string",
            "description": "The flow id."
          },
          "questName": {
            "type": "string"
          },
          "nodeId": {
            "type": "string",
            "description": "The task id."
          },
          "nodeTitle": {
            "type": "string"
          },
          "hours": {
            "type": [
              "number",
              "null"
            ]
          },
          "criticalPath": {
            "type": "boolean"
          }
        }
      },
      "description": "Assigned to them and unblocked."
    },
    "inProgress": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "questId": {
            "type": "string",
            "description": "The flow id."
          },
          "questName": {
            "type": "string"
          },
          "nodeId": {
            "type": "string",
            "description": "The task id."
          },
          "nodeTitle": {
            "type": "string"
          },
          "hours": {
            "type": [
              "number",
              "null"
            ]
          },
          "criticalPath": {
            "type": "boolean"
          }
        }
      }
    },
    "blocked": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "questId": {
            "type": "string",
            "description": "The flow id."
          },
          "questName": {
            "type": "string"
          },
          "nodeId": {
            "type": "string",
            "description": "The task id."
          },
          "nodeTitle": {
            "type": "string"
          },
          "hours": {
            "type": [
              "number",
              "null"
            ]
          },
          "criticalPath": {
            "type": "boolean"
          }
        }
      },
      "description": "Theirs, waiting on someone else."
    },
    "available": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "questId": {
            "type": "string",
            "description": "The flow id."
          },
          "questName": {
            "type": "string"
          },
          "nodeId": {
            "type": "string",
            "description": "The task id."
          },
          "nodeTitle": {
            "type": "string"
          },
          "hours": {
            "type": [
              "number",
              "null"
            ]
          },
          "criticalPath": {
            "type": "boolean"
          }
        }
      },
      "description": "Unassigned and ready — anyone could pick it up."
    },
    "completed": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Finished in the last 24 hours, across their flows."
    },
    "atRisk": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Flows projected to finish after their due date."
    }
  },
  "required": [
    "memberId",
    "wouldSend",
    "counts"
  ]
}