feat: set timezone space level
All checks were successful
Deploy / build-and-deploy (push) Successful in 2m25s

This commit is contained in:
juancwu 2026-03-03 14:48:11 +00:00
commit 08f6b034f5
12 changed files with 196 additions and 23 deletions

View file

@ -13,10 +13,24 @@ type Space struct {
ID string `db:"id"`
Name string `db:"name"`
OwnerID string `db:"owner_id"`
Timezone *string `db:"timezone"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
// Location returns the *time.Location for this space's timezone.
// Returns nil if timezone is not set, so callers can distinguish "not set" from "UTC".
func (s *Space) Location() *time.Location {
if s.Timezone == nil || *s.Timezone == "" {
return nil
}
loc, err := time.LoadLocation(*s.Timezone)
if err != nil {
return nil
}
return loc
}
type SpaceMember struct {
SpaceID string `db:"space_id"`
UserID string `db:"user_id"`