Add NoOp email service, /docs shortcut and fix streak timezone bug

Replace nil email service pattern with NoOpEmailService (Null Object)
to eliminate nil pointer panics across all handlers.

Add /docs route as a shortcut to Swagger UI.

Fix streak calculation returning 0 when server timezone differs from
UTC — CreatedAt was not converted to UTC before date extraction.
This commit is contained in:
2026-03-27 00:32:10 +01:00
parent 67fc508384
commit a07d033e93
10 changed files with 42 additions and 16 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ func main() {
jwtService := auth.NewJWTService(cfg.JWTSecret, jwtExpiryHours)
passwordHasher := crypto.NewBcryptHasher()
var emailService services.EmailService
var emailService services.EmailService = &services.NoOpEmailService{}
if cfg.SMTPHost != "" {
smtpPort, err := strconv.Atoi(cfg.SMTPPort)
if err != nil {