package user import ( "encoding/json" "time" ) type User struct { ID string `json:"id"` FirebaseUID string `json:"-"` Email string `json:"email"` Name string `json:"name"` AvatarURL *string `json:"avatar_url"` HeightCM *int `json:"height_cm"` WeightKG *float64 `json:"weight_kg"` DateOfBirth *string `json:"date_of_birth"` Gender *string `json:"gender"` Activity *string `json:"activity"` Goal *string `json:"goal"` DailyCalories *int `json:"daily_calories"` Plan string `json:"plan"` Preferences json.RawMessage `json:"preferences"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } type UpdateProfileRequest struct { Name *string `json:"name"` HeightCM *int `json:"height_cm"` WeightKG *float64 `json:"weight_kg"` DateOfBirth *string `json:"date_of_birth"` Gender *string `json:"gender"` Activity *string `json:"activity"` Goal *string `json:"goal"` Preferences *json.RawMessage `json:"preferences"` DailyCalories *int `json:"daily_calories,omitempty"` } // HasBodyParams returns true if any body parameter is being updated // that would require recalculation of daily calories. func (r *UpdateProfileRequest) HasBodyParams() bool { return r.HeightCM != nil || r.WeightKG != nil || r.DateOfBirth != nil || r.Gender != nil || r.Activity != nil || r.Goal != nil }