{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "dataPoint": {
      "properties": {
        "date": {
          "format": "datetime",
          "type": "string"
        },
        "value": {
          "description": "Value in base units (meters, seconds, calories, count, bpm)",
          "type": "integer"
        }
      },
      "required": [
        "date",
        "value"
      ],
      "type": "object"
    },
    "main": {
      "description": "A shared fitness trend or dashboard snapshot",
      "key": "tid",
      "record": {
        "properties": {
          "caption": {
            "maxLength": 512,
            "type": "string"
          },
          "chartStyle": {
            "knownValues": [
              "line",
              "bar"
            ],
            "maxLength": 64,
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "dataPoints": {
            "items": {
              "ref": "#dataPoint",
              "type": "ref"
            },
            "type": "array"
          },
          "image": {
            "accept": [
              "image/png",
              "image/jpeg"
            ],
            "maxSize": 1000000,
            "type": "blob"
          },
          "metric": {
            "knownValues": [
              "distance",
              "duration",
              "pace",
              "steps",
              "calories",
              "heartRate",
              "workoutCount"
            ],
            "maxLength": 64,
            "type": "string"
          },
          "period": {
            "knownValues": [
              "1d",
              "7d",
              "30d",
              "90d",
              "1y"
            ],
            "maxLength": 64,
            "type": "string"
          },
          "summary": {
            "ref": "#trendSummary",
            "type": "ref"
          },
          "widgetType": {
            "knownValues": [
              "today-summary",
              "weekly-progress",
              "goal-progress",
              "recent-workouts",
              "custom-trend"
            ],
            "maxLength": 64,
            "type": "string"
          }
        },
        "required": [
          "widgetType",
          "metric",
          "period",
          "summary",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "trendSummary": {
      "properties": {
        "average": {
          "description": "Average value in base units",
          "type": "integer"
        },
        "best": {
          "description": "Best value in base units",
          "type": "integer"
        },
        "count": {
          "type": "integer"
        },
        "total": {
          "description": "Total value in base units",
          "type": "integer"
        },
        "worst": {
          "description": "Worst value in base units",
          "type": "integer"
        }
      },
      "type": "object"
    }
  },
  "id": "app.fitsky.trend",
  "lexicon": 1
}
