added account

This commit is contained in:
2025-10-25 15:55:25 +02:00
parent 72c50549d7
commit 4db5084bc6
15 changed files with 1214 additions and 150 deletions

View File

@@ -2,16 +2,34 @@ package models
import "time"
// User represents a user account
type User struct {
ID int `json:"id"`
Email string `json:"email"`
PasswordHash string `json:"-"` // never expose in JSON
CreatedAt time.Time `json:"created_at"`
}
// Session represents a user session
type Session struct {
Token string `json:"token"`
UserID int `json:"user_id"`
ExpiresAt time.Time `json:"expires_at"`
CreatedAt time.Time `json:"created_at"`
}
// Ingredient represents a food ingredient
type Ingredient struct {
ID int `json:"id"`
Name string `json:"name"`
Unit string `json:"unit"` // e.g., "grams", "ml", "cups", "pieces", "tbsp"
ID int `json:"id"`
UserID int `json:"user_id"`
Name string `json:"name"`
Unit string `json:"unit"` // e.g., "grams", "ml", "cups", "pieces", "tbsp"
}
// Meal represents a meal recipe
type Meal struct {
ID int `json:"id"`
UserID int `json:"user_id"`
Name string `json:"name"`
Description string `json:"description"`
MealType string `json:"meal_type"` // "breakfast", "lunch", "snack"