23 lines
742 B
Go
23 lines
742 B
Go
// Package telegram is the notifications module (spec section 20): the
|
|
// admin configures a bot token + chat id and toggles which events trigger a
|
|
// message. It is a pluggable notifier -- other modules (orders) depend on
|
|
// the small OrderNotifier interface it satisfies, never on Telegram
|
|
// directly, so a future module (email, WhatsApp, ...) can be swapped in the
|
|
// same way.
|
|
package telegram
|
|
|
|
import "time"
|
|
|
|
type Settings struct {
|
|
ID int16 `gorm:"primaryKey"`
|
|
Enabled bool
|
|
BotToken string
|
|
ChatID string
|
|
NotifyNewOrder bool
|
|
NotifyStatusChange bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
func (Settings) TableName() string { return "telegram_settings" }
|