{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sortiri.ai/onboarding-draft.schema.json",
  "title": "SortiriOnboardingDraft",
  "type": "object",
  "required": ["answers"],
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "description": "Optional email to prefill on the claim page"
    },
    "answers": {
      "type": "object",
      "required": [
        "goal",
        "mealsPerDay",
        "workoutsPerWeek",
        "weighInsPerWeek",
        "dob",
        "gender",
        "units",
        "height",
        "currentWeight",
        "activityLevel",
        "notificationsEnabled",
        "aiConsentAccepted",
        "dailyWaterGoalMl",
        "dailyCalorieGoal",
        "macroProtein",
        "macroCarbs",
        "macroFat",
        "pregnancyModeEnabled",
        "cycleTrackingEnabled"
      ],
      "properties": {
        "goal": {
          "enum": ["lose_fat", "build_muscle", "recomp", "maintain"]
        },
        "mealsPerDay": { "type": "integer", "minimum": 2, "maximum": 5 },
        "workoutsPerWeek": { "type": "integer", "minimum": 2, "maximum": 5 },
        "weighInsPerWeek": { "type": "integer", "enum": [1, 2, 3, 7] },
        "dob": { "type": "string", "format": "date" },
        "gender": { "enum": ["male", "female", "other"] },
        "units": { "enum": ["metric", "imperial"] },
        "height": { "type": "string" },
        "currentWeight": { "type": "string" },
        "activityLevel": { "type": "integer", "enum": [20, 40, 50, 70, 90] },
        "notificationsEnabled": { "type": "boolean" },
        "aiConsentAccepted": { "type": "boolean" },
        "betaAccessOptIn": {
          "type": "boolean",
          "description": "Opt in to Sortiri beta early access (defaults true on web setup)"
        },
        "email": { "type": "string", "format": "email" },
        "dailyWaterGoalMl": { "type": "integer" },
        "dailyCalorieGoal": { "type": "integer" },
        "macroProtein": { "type": "integer" },
        "macroCarbs": { "type": "integer" },
        "macroFat": { "type": "integer" },
        "pregnancyModeEnabled": { "type": "boolean" },
        "pregnancyDueDateStr": { "type": "string", "format": "date" },
        "cycleTrackingEnabled": { "type": "boolean" },
        "lastPeriodStartDateStr": { "type": "string", "format": "date" },
        "averageCycleLengthDays": { "type": "integer", "enum": [26, 28, 30, 32] }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
