Remove timezone from User model and pass as request parameter

Timezone is now sent from the client on each request that needs it,
instead of storing it in the database. This simplifies the model and
allows timezone to be dynamic (useful for traveling users).

Changes:
- Remove timezone field from User entity
- Remove timezone from user registration
- GET /habits/today now requires ?timezone= query param
- Add migration to drop timezone column from database
- Update related tests
This commit is contained in:
2025-11-29 16:18:04 +01:00
parent a2aa8b2a76
commit 5d92820591
21 changed files with 75 additions and 153 deletions
+1 -5
View File
@@ -114,7 +114,7 @@ func ValidateTimezone(timezone string) error {
return nil
}
func ValidateRegistration(email, password, timezone string) error {
func ValidateRegistration(email, password string) error {
if err := ValidateEmail(email); err != nil {
return err
}
@@ -123,9 +123,5 @@ func ValidateRegistration(email, password, timezone string) error {
return err
}
if err := ValidateTimezone(timezone); err != nil {
return err
}
return nil
}