a07d033e93
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.
21 lines
457 B
Go
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 }
|