mirror of
https://github.com/escalante29/healthy-fit.git
synced 2026-03-21 15:08:46 +01:00
- Supplement tracking: CRUD endpoints, /today, /logs, Supplements page - Kettlebell workouts: session tracking, analytics endpoint, ActiveSession page - Calendar module: events CRUD, calendar components - Push notifications: VAPID keys, PushSubscription model, APScheduler reminders, service worker with push/notificationclick handlers, Profile notifications UI - PWA: vite-plugin-pwa, manifest, icons, service worker generation - Frontend: TypeScript types, API modules, ConfirmModal, toast notifications - Auth fixes: password hashing, nutrition endpoint auth - CLAUDE.md: project documentation and development guide Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
1.0 KiB
Python
28 lines
1.0 KiB
Python
import datetime as dt
|
||
from typing import Optional
|
||
|
||
from sqlmodel import Field, SQLModel
|
||
|
||
|
||
class DailyNote(SQLModel, table=True):
|
||
id: Optional[int] = Field(default=None, primary_key=True)
|
||
user_id: int = Field(foreign_key="user.id", index=True)
|
||
date: dt.date = Field(index=True)
|
||
content: str = Field(default="", max_length=10000)
|
||
mood: Optional[str] = None # "great"/"good"/"okay"/"bad"/"awful"
|
||
energy_level: Optional[int] = None # 1–10
|
||
updated_at: dt.datetime = Field(default_factory=dt.datetime.utcnow)
|
||
|
||
|
||
class CalendarEvent(SQLModel, table=True):
|
||
id: Optional[int] = Field(default=None, primary_key=True)
|
||
user_id: int = Field(foreign_key="user.id", index=True)
|
||
date: dt.date = Field(index=True)
|
||
title: str
|
||
description: Optional[str] = None
|
||
event_type: str = "general" # "workout" | "supplement" | "general"
|
||
color: Optional[str] = None
|
||
start_time: Optional[str] = None # "HH:MM"
|
||
is_completed: bool = False
|
||
created_at: dt.datetime = Field(default_factory=dt.datetime.utcnow)
|