Files
apocapoc-api/internal/domain/services/email_service.go
T
david a07d033e93 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.
2026-03-27 00:32:10 +01:00

21 lines
457 B
Go

package services
type EmailMessage struct {
To string
Subject string
Body string
IsHTML bool
}
type EmailService interface {
Send(message EmailMessage) error
HealthCheck() error
IsEnabled() bool
}
type NoOpEmailService struct{}
func (n *NoOpEmailService) Send(_ EmailMessage) error { return nil }
func (n *NoOpEmailService) HealthCheck() error { return nil }
func (n *NoOpEmailService) IsEnabled() bool { return false }