lots of stuff, don't truly remember

This commit is contained in:
Blake Ridgway
2026-05-17 20:39:47 -05:00
parent 178ffb3425
commit dc4fe558b7
35 changed files with 3501 additions and 112 deletions

42
internal/goal/model.go Normal file
View File

@@ -0,0 +1,42 @@
package goal
import "time"
// GoalType defines categories of goals users can set.
type GoalType string
const (
GoalDistance GoalType = "distance"
GoalFrequency GoalType = "frequency"
GoalPower GoalType = "power"
GoalWeight GoalType = "weight"
GoalCustom GoalType = "custom"
)
// GoalStatus tracks the lifecycle of a goal.
type GoalStatus string
const (
StatusActive GoalStatus = "active"
StatusCompleted GoalStatus = "completed"
StatusArchived GoalStatus = "archived"
)
type Goal struct {
ID uint `gorm:"primaryKey" json:"id"`
UserID uint `gorm:"not null;index" json:"user_id"`
Title string `gorm:"not null" json:"title"`
Description string `gorm:"default:''" json:"description"`
GoalType GoalType `gorm:"default:'custom'" json:"goal_type"`
TargetValue float64 `gorm:"not null;default:0" json:"target_value"`
CurrentValue float64 `gorm:"default:0" json:"current_value"`
TargetDate *time.Time `json:"target_date,omitempty"`
Status GoalStatus `gorm:"default:'active'" json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (Goal) TableName() string {
return "goals"
}