going full courtside
This commit is contained in:
@@ -82,12 +82,11 @@ type CheckpointDetail struct {
|
||||
}
|
||||
|
||||
type NotificationConfig struct {
|
||||
UserID string `json:"user_id"`
|
||||
DiscordWebhookURL *string `json:"discord_webhook_url"`
|
||||
TelegramChatID *string `json:"telegram_chat_id"`
|
||||
TelegramBotToken *string `json:"telegram_bot_token,omitempty"`
|
||||
Email *string `json:"email"`
|
||||
NotificationEnabled bool `json:"notification_enabled"`
|
||||
UserID string `json:"user_id"`
|
||||
DiscordWebhookURL *string `json:"discord_webhook_url"`
|
||||
SlackWebhookURL *string `json:"slack_webhook_url"`
|
||||
Email *string `json:"email"`
|
||||
NotificationEnabled bool `json:"notification_enabled"`
|
||||
CreatedAt *time.Time `json:"created_at,omitempty"`
|
||||
UpdatedAt *time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
35
backend-go/internal/domain/types_test.go
Normal file
35
backend-go/internal/domain/types_test.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package domain
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestIsValidAlertType(t *testing.T) {
|
||||
valid := []string{"incoming_tx", "outgoing_tx", "large_transfer", "balance_below"}
|
||||
for _, v := range valid {
|
||||
if !IsValidAlertType(v) {
|
||||
t.Errorf("IsValidAlertType(%q) = false, want true", v)
|
||||
}
|
||||
}
|
||||
|
||||
invalid := []string{"", "invalid", "INCOMING_TX", "send", "receive"}
|
||||
for _, v := range invalid {
|
||||
if IsValidAlertType(v) {
|
||||
t.Errorf("IsValidAlertType(%q) = true, want false", v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsThresholdRequired(t *testing.T) {
|
||||
required := []AlertType{AlertLargeTransfer, AlertBalanceBelow}
|
||||
for _, at := range required {
|
||||
if !IsThresholdRequired(at) {
|
||||
t.Errorf("IsThresholdRequired(%q) = false, want true", at)
|
||||
}
|
||||
}
|
||||
|
||||
notRequired := []AlertType{AlertIncomingTx, AlertOutgoingTx}
|
||||
for _, at := range notRequired {
|
||||
if IsThresholdRequired(at) {
|
||||
t.Errorf("IsThresholdRequired(%q) = true, want false", at)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user