openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.2.0 description: Lumino - Emotional Wellness Platform API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: user description: User profile and progress - name: checkins description: Daily emotional check-ins - name: journal description: Journal entries - name: tasks description: Task management (Anti-Chaos layer) - name: projects description: Project management - name: anti-chaos description: Anti-Chaos intelligence layer - name: lumino description: Lumino wellness features paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /lumino/profile: get: operationId: getUserProfile tags: [user] summary: Get user profile, XP, level, streak responses: "200": description: User profile content: application/json: schema: $ref: "#/components/schemas/UserProfile" patch: operationId: updateUserProfile tags: [user] summary: Update user profile requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateUserProfileBody" responses: "200": description: Updated profile content: application/json: schema: $ref: "#/components/schemas/UserProfile" /lumino/checkins: get: operationId: listCheckins tags: [checkins] summary: List recent check-ins parameters: - name: limit in: query schema: type: integer - name: type in: query schema: type: string enum: [morning, evening] responses: "200": description: List of check-ins content: application/json: schema: type: array items: $ref: "#/components/schemas/Checkin" post: operationId: createCheckin tags: [checkins] summary: Create a daily check-in requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateCheckinBody" responses: "201": description: Created check-in content: application/json: schema: $ref: "#/components/schemas/Checkin" /lumino/checkins/today: get: operationId: getTodayCheckins tags: [checkins] summary: Get today's check-ins (morning + evening) responses: "200": description: Today's check-ins content: application/json: schema: $ref: "#/components/schemas/TodayCheckins" /lumino/journal: get: operationId: listJournalEntries tags: [journal] summary: List journal entries parameters: - name: limit in: query schema: type: integer - name: offset in: query schema: type: integer responses: "200": description: Journal entries content: application/json: schema: type: array items: $ref: "#/components/schemas/JournalEntry" post: operationId: createJournalEntry tags: [journal] summary: Create a journal entry requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateJournalEntryBody" responses: "201": description: Created entry content: application/json: schema: $ref: "#/components/schemas/JournalEntry" /lumino/journal/{id}: get: operationId: getJournalEntry tags: [journal] summary: Get a journal entry parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Journal entry content: application/json: schema: $ref: "#/components/schemas/JournalEntry" patch: operationId: updateJournalEntry tags: [journal] summary: Update a journal entry parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateJournalEntryBody" responses: "200": description: Updated entry content: application/json: schema: $ref: "#/components/schemas/JournalEntry" delete: operationId: deleteJournalEntry tags: [journal] summary: Delete a journal entry parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted /lumino/insights: get: operationId: getMoodInsights tags: [lumino] summary: Get mood patterns and AI insights responses: "200": description: Mood insights content: application/json: schema: $ref: "#/components/schemas/MoodInsights" /lumino/achievements: get: operationId: listAchievements tags: [lumino] summary: List user achievements responses: "200": description: Achievements content: application/json: schema: type: array items: $ref: "#/components/schemas/Achievement" /lumino/breathe: post: operationId: recordBreathingSession tags: [lumino] summary: Record a completed breathing/calm session requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RecordBreathingSessionBody" responses: "201": description: Session recorded content: application/json: schema: $ref: "#/components/schemas/BreathingSession" /lumino/dashboard: get: operationId: getLuminoDashboard tags: [lumino] summary: Get full Lumino wellness dashboard responses: "200": description: Lumino dashboard content: application/json: schema: $ref: "#/components/schemas/LuminoDashboard" /tasks: get: operationId: listTasks tags: [tasks] summary: List all tasks parameters: - name: projectId in: query schema: type: integer - name: status in: query schema: type: string enum: [todo, in_progress, done, archived] - name: priority in: query schema: type: string enum: [critical, high, medium, low] responses: "200": description: List of tasks content: application/json: schema: type: array items: $ref: "#/components/schemas/Task" post: operationId: createTask tags: [tasks] summary: Create a new task requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateTaskBody" responses: "201": description: Created task content: application/json: schema: $ref: "#/components/schemas/Task" /tasks/{id}: get: operationId: getTask tags: [tasks] summary: Get a task by ID parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Task content: application/json: schema: $ref: "#/components/schemas/Task" patch: operationId: updateTask tags: [tasks] summary: Update a task parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateTaskBody" responses: "200": description: Updated task content: application/json: schema: $ref: "#/components/schemas/Task" delete: operationId: deleteTask tags: [tasks] summary: Delete a task parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted /projects: get: operationId: listProjects tags: [projects] summary: List all projects responses: "200": description: List of projects content: application/json: schema: type: array items: $ref: "#/components/schemas/Project" post: operationId: createProject tags: [projects] summary: Create a project requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateProjectBody" responses: "201": description: Created project content: application/json: schema: $ref: "#/components/schemas/Project" /projects/{id}: get: operationId: getProject tags: [projects] summary: Get a project parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Project content: application/json: schema: $ref: "#/components/schemas/Project" patch: operationId: updateProject tags: [projects] summary: Update a project parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateProjectBody" responses: "200": description: Updated project content: application/json: schema: $ref: "#/components/schemas/Project" delete: operationId: deleteProject tags: [projects] summary: Delete a project parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted /anti-chaos/score: get: operationId: getChaosScore tags: [anti-chaos] summary: Get the global Chaos Score responses: "200": description: Chaos score data content: application/json: schema: $ref: "#/components/schemas/ChaosScore" /anti-chaos/suggestions: get: operationId: getSuggestions tags: [anti-chaos] summary: Get smart suggestions responses: "200": description: Smart suggestions content: application/json: schema: type: array items: $ref: "#/components/schemas/Suggestion" /anti-chaos/priorities: get: operationId: getPriorityOverlay tags: [anti-chaos] summary: Get priority overlay for tasks responses: "200": description: Priority overlay data content: application/json: schema: type: array items: $ref: "#/components/schemas/TaskPriorityOverlay" /anti-chaos/dashboard: get: operationId: getDashboardSummary tags: [anti-chaos] summary: Get dashboard summary responses: "200": description: Dashboard summary content: application/json: schema: $ref: "#/components/schemas/DashboardSummary" /anti-chaos/interactions: post: operationId: recordInteraction tags: [anti-chaos] summary: Record a user interaction requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RecordInteractionBody" responses: "204": description: Recorded /anti-chaos/arrival: post: operationId: saveClarityArrival tags: [anti-chaos] summary: Save daily arrival check-in ("Como você está chegando hoje?") requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SaveClarityArrivalBody" responses: "201": description: Arrival saved content: application/json: schema: $ref: "#/components/schemas/ClarityArrival" /anti-chaos/arrival/today: get: operationId: getTodayArrival tags: [anti-chaos] summary: Get today's arrival check-in responses: "200": description: Today's arrival (null if not done) content: application/json: schema: $ref: "#/components/schemas/ClarityArrivalOrNull" /anti-chaos/reflection: post: operationId: saveClarityReflection tags: [anti-chaos] summary: Save end-of-day clarity reflection requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SaveClarityReflectionBody" responses: "201": description: Reflection saved content: application/json: schema: $ref: "#/components/schemas/ClarityReflection" /anti-chaos/reflection/today: get: operationId: getTodayReflection tags: [anti-chaos] summary: Get today's reflection (null if not done) responses: "200": description: Today's reflection content: application/json: schema: $ref: "#/components/schemas/ClarityReflectionOrNull" /anti-chaos/next-step: get: operationId: getNextStep tags: [anti-chaos] summary: Get the "Próximo 1%" — single recommended micro-action responses: "200": description: Next recommended step content: application/json: schema: $ref: "#/components/schemas/NextStep" /anti-chaos/history: get: operationId: getClarityHistory tags: [anti-chaos] summary: Get clarity history log (arrivals + reflections) parameters: - name: limit in: query schema: type: integer responses: "200": description: Clarity history content: application/json: schema: $ref: "#/components/schemas/ClarityHistory" /nutrivida/profile: get: operationId: getNutriProfile tags: [nutrivida] summary: Get NutriVida user profile responses: "200": description: NutriVida profile content: application/json: schema: $ref: "#/components/schemas/NutriProfile" patch: operationId: updateNutriProfile tags: [nutrivida] summary: Update NutriVida user profile requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateNutriProfileBody" responses: "200": description: Updated profile content: application/json: schema: $ref: "#/components/schemas/NutriProfile" /nutrivida/life-areas: get: operationId: getNutriLifeAreas tags: [nutrivida] summary: Get all life areas with nutrition levels responses: "200": description: Life areas content: application/json: schema: type: array items: $ref: "#/components/schemas/NutriLifeArea" post: operationId: logNutriActivity tags: [nutrivida] summary: Log an activity for a life area requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LogNutriActivityBody" responses: "201": description: Activity logged content: application/json: schema: $ref: "#/components/schemas/NutriActivityResult" /nutrivida/daily-cycle: get: operationId: getNutriDailyCycles tags: [nutrivida] summary: List recent daily cycles parameters: - name: limit in: query schema: type: integer responses: "200": description: Daily cycles content: application/json: schema: type: array items: $ref: "#/components/schemas/NutriDailyCycle" /nutrivida/daily-cycle/today: get: operationId: getNutriTodayCycle tags: [nutrivida] summary: Get today's daily cycle responses: "200": description: Today's cycle content: application/json: schema: $ref: "#/components/schemas/NutriDailyCycle" /nutrivida/daily-cycle/morning: post: operationId: completeMorningCheckin tags: [nutrivida] summary: Complete morning check-in requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/MorningCheckinBody" responses: "201": description: Morning check-in saved content: application/json: schema: $ref: "#/components/schemas/NutriDailyCycle" /nutrivida/daily-cycle/evening: post: operationId: completeEveningCheckin tags: [nutrivida] summary: Complete evening check-in requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/EveningCheckinBody" responses: "201": description: Evening check-in saved content: application/json: schema: $ref: "#/components/schemas/NutriDailyCycle" /nutrivida/relax: post: operationId: recordNutriRelax tags: [nutrivida] summary: Record a relaxation session requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RecordNutriRelaxBody" responses: "201": description: Session recorded content: application/json: schema: $ref: "#/components/schemas/NutriRelaxResult" /nutrivida/insights: get: operationId: getNutriInsights tags: [nutrivida] summary: Get personalized AI insights responses: "200": description: Insights content: application/json: schema: $ref: "#/components/schemas/NutriInsights" /nutrivida/dashboard: get: operationId: getNutriDashboard tags: [nutrivida] summary: Get full NutriVida dashboard responses: "200": description: NutriVida dashboard content: application/json: schema: $ref: "#/components/schemas/NutriDashboard" /nutrivida/carinhos/earn: post: operationId: earnCarinhos tags: [nutrivida] summary: Earn carinhos for an action requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/EarnCarinhosBody" responses: "200": description: Carinhos earned content: application/json: schema: $ref: "#/components/schemas/CarinhosResult" /nutrivida/professional/patients: get: operationId: getProfessionalPatients tags: [nutrivida] summary: Get list of patients linked to professional responses: "200": description: Patients list content: application/json: schema: type: array items: $ref: "#/components/schemas/PatientSummary" /nutrivida/professional/microtasks: post: operationId: createMicroTask tags: [nutrivida] summary: Create a micro-task for a patient requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateMicroTaskBody" responses: "201": description: Micro-task created content: application/json: schema: $ref: "#/components/schemas/NutriMicroTask" /nutrivida/professional/link: post: operationId: createProfessionalLink tags: [nutrivida] summary: Generate invite link for a patient responses: "201": description: Link created content: application/json: schema: $ref: "#/components/schemas/ProfessionalLink" /nutrivida/professional/link/{code}/accept: post: operationId: acceptProfessionalLink tags: [nutrivida] summary: Accept a professional link via invite code parameters: - name: code in: path required: true schema: type: string responses: "200": description: Link accepted content: application/json: schema: $ref: "#/components/schemas/ProfessionalLink" /nutrivida/microtasks: get: operationId: getMyMicroTasks tags: [nutrivida] summary: Get micro-tasks for current patient responses: "200": description: Micro-tasks content: application/json: schema: type: array items: $ref: "#/components/schemas/NutriMicroTask" /nutrivida/microtasks/{id}/respond: post: operationId: respondMicroTask tags: [nutrivida] summary: Respond to a micro-task parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RespondMicroTaskBody" responses: "200": description: Response saved content: application/json: schema: $ref: "#/components/schemas/NutriMicroTask" components: schemas: HealthStatus: type: object properties: status: type: string required: [status] UserProfile: type: object properties: id: type: integer name: type: string avatarLevel: type: integer xp: type: integer xpToNextLevel: type: integer level: type: integer levelTitle: type: string streakDays: type: integer totalCheckins: type: integer totalJournalEntries: type: integer totalBreathingSessions: type: integer companionName: type: string nullable: true companionMood: type: string nullable: true createdAt: type: string required: - id - name - avatarLevel - xp - xpToNextLevel - level - levelTitle - streakDays - totalCheckins - totalJournalEntries - totalBreathingSessions - createdAt UpdateUserProfileBody: type: object properties: name: type: string companionName: type: string Checkin: type: object properties: id: type: integer type: type: string enum: [morning, evening] moodScore: type: integer description: 1-10 mood rating moodLabel: type: string energyLevel: type: integer description: 1-5 energy level intention: type: string nullable: true gratitude: type: string nullable: true reflection: type: string nullable: true learned: type: string nullable: true selfCare: type: array items: type: string createdAt: type: string required: - id - type - moodScore - moodLabel - energyLevel - createdAt CreateCheckinBody: type: object properties: type: type: string enum: [morning, evening] moodScore: type: integer moodLabel: type: string energyLevel: type: integer intention: type: string gratitude: type: string reflection: type: string learned: type: string selfCare: type: array items: type: string required: - type - moodScore - moodLabel - energyLevel TodayCheckins: type: object properties: morning: nullable: true allOf: - $ref: "#/components/schemas/Checkin" evening: nullable: true allOf: - $ref: "#/components/schemas/Checkin" morningDone: type: boolean eveningDone: type: boolean required: - morningDone - eveningDone JournalEntry: type: object properties: id: type: integer title: type: string nullable: true content: type: string moodScore: type: integer nullable: true tags: type: array items: type: string wordCount: type: integer createdAt: type: string updatedAt: type: string required: - id - content - wordCount - createdAt - updatedAt CreateJournalEntryBody: type: object properties: title: type: string content: type: string moodScore: type: integer tags: type: array items: type: string required: - content UpdateJournalEntryBody: type: object properties: title: type: string content: type: string moodScore: type: integer tags: type: array items: type: string MoodInsights: type: object properties: averageMood: type: number moodTrend: type: string enum: [rising, stable, falling] bestDayOfWeek: type: string nullable: true worstDayOfWeek: type: string nullable: true insights: type: array items: type: string moodHistory: type: array items: $ref: "#/components/schemas/MoodDataPoint" streakInfo: type: string required: - averageMood - moodTrend - insights - moodHistory - streakInfo MoodDataPoint: type: object properties: date: type: string avgMood: type: number count: type: integer required: - date - avgMood - count Achievement: type: object properties: id: type: string title: type: string description: type: string icon: type: string unlockedAt: type: string nullable: true isUnlocked: type: boolean category: type: string enum: [streak, journal, breathe, mood, social] xpReward: type: integer required: - id - title - description - icon - isUnlocked - category - xpReward BreathingSession: type: object properties: id: type: integer technique: type: string enum: [box,478, coherent, wim_hof, custom] durationSeconds: type: integer rounds: type: integer calmScore: type: integer nullable: true xpEarned: type: integer createdAt: type: string required: - id - technique - durationSeconds - rounds - xpEarned - createdAt RecordBreathingSessionBody: type: object properties: technique: type: string enum: [box, 478, coherent, wim_hof, custom] durationSeconds: type: integer rounds: type: integer calmScore: type: integer required: - technique - durationSeconds - rounds LuminoDashboard: type: object properties: profile: $ref: "#/components/schemas/UserProfile" todayCheckins: $ref: "#/components/schemas/TodayCheckins" recentMoodAvg: type: number moodTrend: type: string enum: [rising, stable, falling] journalCount: type: integer breathingSessionsThisWeek: type: integer recentJournalEntries: type: array items: $ref: "#/components/schemas/JournalEntry" topAchievements: type: array items: $ref: "#/components/schemas/Achievement" dailyPrompt: type: string companionMessage: type: string required: - profile - todayCheckins - recentMoodAvg - moodTrend - journalCount - breathingSessionsThisWeek - recentJournalEntries - topAchievements - dailyPrompt - companionMessage Task: type: object properties: id: type: integer title: type: string description: type: string nullable: true status: type: string enum: [todo, in_progress, done, archived] priority: type: string enum: [critical, high, medium, low] projectId: type: integer nullable: true dueDate: type: string nullable: true completedAt: type: string nullable: true priorityScore: type: number nullable: true chaosWeight: type: number nullable: true context: type: string nullable: true createdAt: type: string updatedAt: type: string required: - id - title - status - priority - createdAt - updatedAt CreateTaskBody: type: object properties: title: type: string description: type: string status: type: string enum: [todo, in_progress, done, archived] priority: type: string enum: [critical, high, medium, low] projectId: type: integer dueDate: type: string context: type: string required: - title UpdateTaskBody: type: object properties: title: type: string description: type: string status: type: string enum: [todo, in_progress, done, archived] priority: type: string enum: [critical, high, medium, low] projectId: type: integer dueDate: type: string completedAt: type: string context: type: string priorityScore: type: number chaosWeight: type: number Project: type: object properties: id: type: integer name: type: string description: type: string nullable: true color: type: string nullable: true taskCount: type: integer completedCount: type: integer overdueCount: type: integer chaosScore: type: number nullable: true createdAt: type: string updatedAt: type: string required: - id - name - taskCount - completedCount - overdueCount - createdAt - updatedAt CreateProjectBody: type: object properties: name: type: string description: type: string color: type: string required: - name UpdateProjectBody: type: object properties: name: type: string description: type: string color: type: string ChaosScore: type: object properties: score: type: number level: type: string enum: [calm, moderate, elevated, critical] breakdown: type: object properties: overdueWeight: type: number pendingVolumeWeight: type: number inactivityWeight: type: number required: - overdueWeight - pendingVolumeWeight - inactivityWeight trend: type: string enum: [improving, stable, worsening] overdueCount: type: integer pendingCount: type: integer completedToday: type: integer lastActivityHoursAgo: type: number required: - score - level - breakdown - trend - overdueCount - pendingCount - completedToday - lastActivityHoursAgo Suggestion: type: object properties: id: type: string type: type: string enum: [quick_win, risk_alert, next_action, focus_tip] title: type: string description: type: string taskId: type: integer nullable: true priority: type: string enum: [high, medium, low] actionLabel: type: string nullable: true required: - id - type - title - description - priority TaskPriorityOverlay: type: object properties: taskId: type: integer priorityScore: type: number urgencyLabel: type: string enum: [now, soon, later, defer] chaosContribution: type: number reasonTags: type: array items: type: string required: - taskId - priorityScore - urgencyLabel - chaosContribution - reasonTags DashboardSummary: type: object properties: totalTasks: type: integer completedToday: type: integer overdueCount: type: integer inProgressCount: type: integer todoCount: type: integer criticalCount: type: integer projectCount: type: integer chaosScore: type: number chaosLevel: type: string enum: [calm, moderate, elevated, critical] topPriorityTasks: type: array items: $ref: "#/components/schemas/Task" recentActivity: type: array items: $ref: "#/components/schemas/ActivityItem" completionRate: type: number required: - totalTasks - completedToday - overdueCount - inProgressCount - todoCount - criticalCount - projectCount - chaosScore - chaosLevel - topPriorityTasks - recentActivity - completionRate ActivityItem: type: object properties: id: type: string taskId: type: integer nullable: true action: type: string description: type: string timestamp: type: string required: - id - action - description - timestamp RecordInteractionBody: type: object properties: taskId: type: integer interactionType: type: string enum: [viewed, completed, deferred, prioritized, dismissed_suggestion] metadata: type: object additionalProperties: true required: - interactionType NutriProfile: type: object properties: id: type: integer name: type: string role: type: string enum: [user, professional] companionType: type: string enum: [hedgehog, otter, koala, owl] companionName: type: string nullable: true companionColor: type: string companionAccessory: type: string companionPhase: type: integer carinhos: type: integer streakDays: type: integer totalCycles: type: integer totalRelaxSessions: type: integer onboardingCompleted: type: boolean activeAreas: type: array items: type: string createdAt: type: string required: - id - name - role - companionType - companionPhase - carinhos - streakDays - totalCycles - totalRelaxSessions - onboardingCompleted - activeAreas - createdAt UpdateNutriProfileBody: type: object properties: name: type: string companionType: type: string enum: [hedgehog, otter, koala, owl] companionName: type: string companionColor: type: string companionAccessory: type: string onboardingCompleted: type: boolean activeAreas: type: array items: type: string role: type: string enum: [user, professional] NutriLifeArea: type: object properties: id: type: integer areaType: type: string nutritionLevel: type: integer isActive: type: boolean lastActivityAt: type: string nullable: true recentActivities: type: array items: $ref: "#/components/schemas/NutriAreaActivity" required: - id - areaType - nutritionLevel - isActive - recentActivities NutriAreaActivity: type: object properties: id: type: integer description: type: string nutritionGained: type: integer carinhoGained: type: integer createdAt: type: string required: - id - description - nutritionGained - carinhoGained - createdAt LogNutriActivityBody: type: object properties: areaType: type: string description: type: string nutritionGained: type: integer required: - areaType - description NutriActivityResult: type: object properties: activity: $ref: "#/components/schemas/NutriAreaActivity" newNutritionLevel: type: integer carinhoEarned: type: integer companionReaction: type: string totalCarinhos: type: integer required: - activity - newNutritionLevel - carinhoEarned - companionReaction - totalCarinhos NutriDailyCycle: type: object properties: id: type: integer date: type: string morningMood: type: string nullable: true morningIntention: type: string nullable: true morningCompletedAt: type: string nullable: true eveningMood: type: string nullable: true eveningGratitude: type: string nullable: true eveningTomorrowGoal: type: string nullable: true eveningCompletedAt: type: string nullable: true isComplete: type: boolean carinhoEarned: type: integer createdAt: type: string required: - id - date - isComplete - carinhoEarned - createdAt MorningCheckinBody: type: object properties: mood: type: string intention: type: string diary: type: string required: - mood EveningCheckinBody: type: object properties: mood: type: string gratitude: type: string tomorrowGoal: type: string diary: type: string required: - mood RecordNutriRelaxBody: type: object properties: type: type: string enum: [breathing, memory_game, sos] subtype: type: string durationSeconds: type: integer required: - type - durationSeconds NutriRelaxResult: type: object properties: id: type: integer carinhoEarned: type: integer totalCarinhos: type: integer companionReaction: type: string required: - id - carinhoEarned - totalCarinhos - companionReaction NutriInsights: type: object properties: moodPattern: type: string bestAreaStreak: type: string nullable: true weeklyProgress: type: string affirmation: type: string tipsForToday: type: array items: type: string moodHistory: type: array items: type: object properties: date: type: string morningMood: type: string nullable: true eveningMood: type: string nullable: true required: - date required: - moodPattern - weeklyProgress - affirmation - tipsForToday - moodHistory NutriDashboard: type: object properties: profile: $ref: "#/components/schemas/NutriProfile" lifeAreas: type: array items: $ref: "#/components/schemas/NutriLifeArea" todayCycle: nullable: true allOf: - $ref: "#/components/schemas/NutriDailyCycle" recentCycles: type: array items: $ref: "#/components/schemas/NutriDailyCycle" insights: $ref: "#/components/schemas/NutriInsights" microTasks: type: array items: $ref: "#/components/schemas/NutriMicroTask" companionMessage: type: string required: - profile - lifeAreas - recentCycles - insights - microTasks - companionMessage EarnCarinhosBody: type: object properties: reason: type: string enum: [share, manual, bonus] amount: type: integer required: - reason CarinhosResult: type: object properties: newTotal: type: integer earned: type: integer companionReaction: type: string required: - newTotal - earned - companionReaction PatientSummary: type: object properties: id: type: integer patientId: type: integer patientName: type: string streakDays: type: integer lastCycleDate: type: string nullable: true completedCyclesThisWeek: type: integer averageMood: type: string nullable: true lifeAreasSummary: type: array items: type: object properties: areaType: type: string level: type: integer required: - areaType - level pendingMicroTasks: type: integer linkStatus: type: string required: - id - patientId - patientName - streakDays - completedCyclesThisWeek - lifeAreasSummary - pendingMicroTasks - linkStatus NutriMicroTask: type: object properties: id: type: integer title: type: string description: type: string nullable: true areaType: type: string nullable: true status: type: string enum: [pending, done, snoozed] response: type: string nullable: true createdAt: type: string respondedAt: type: string nullable: true required: - id - title - status - createdAt CreateMicroTaskBody: type: object properties: patientUserId: type: integer title: type: string description: type: string areaType: type: string required: - patientUserId - title RespondMicroTaskBody: type: object properties: response: type: string enum: ["Fiz", "Tentarei amanhã"] status: type: string enum: [done, snoozed] required: - response - status ProfessionalLink: type: object properties: id: type: integer inviteCode: type: string status: type: string patientUserId: type: integer nullable: true createdAt: type: string required: - id - inviteCode - status - createdAt ClarityArrival: type: object properties: id: type: integer userId: type: integer energyLevel: type: integer description: 1-5 energy scale mentalState: type: string enum: [overwhelmed, scattered, neutral, focused, clear] mainFeeling: type: string nullable: true intention: type: string nullable: true date: type: string createdAt: type: string required: - id - userId - energyLevel - mentalState - date - createdAt ClarityArrivalOrNull: nullable: true allOf: - $ref: "#/components/schemas/ClarityArrival" SaveClarityArrivalBody: type: object properties: energyLevel: type: integer minimum: 1 maximum: 5 mentalState: type: string enum: [overwhelmed, scattered, neutral, focused, clear] mainFeeling: type: string intention: type: string required: - energyLevel - mentalState ClarityReflection: type: object properties: id: type: integer userId: type: integer clarityGained: type: string nullable: true mainWin: type: string nullable: true emotionalNote: type: string nullable: true tomorrowIntention: type: string nullable: true clarityScore: type: integer nullable: true description: 1-10 self-assessed clarity date: type: string createdAt: type: string required: - id - userId - date - createdAt ClarityReflectionOrNull: nullable: true allOf: - $ref: "#/components/schemas/ClarityReflection" SaveClarityReflectionBody: type: object properties: clarityGained: type: string mainWin: type: string emotionalNote: type: string tomorrowIntention: type: string clarityScore: type: integer minimum: 1 maximum: 10 NextStep: type: object properties: taskId: type: integer nullable: true title: type: string description: type: string urgencyLabel: type: string enum: [now, soon, later, defer] estimatedMinutes: type: integer nullable: true source: type: string enum: [ai, professional, user] description: Who originated this step required: - title - description - urgencyLabel - source ClarityHistoryEntry: type: object properties: date: type: string arrival: nullable: true allOf: - $ref: "#/components/schemas/ClarityArrival" reflection: nullable: true allOf: - $ref: "#/components/schemas/ClarityReflection" tasksCompleted: type: integer clarityDelta: type: number description: Change in clarity score vs previous day required: - date - tasksCompleted ClarityHistory: type: object properties: entries: type: array items: $ref: "#/components/schemas/ClarityHistoryEntry" averageClarityScore: type: number nullable: true currentStreak: type: integer required: - entries - currentStreak