template-monorepo/internal/model/notification/domain/usecase/dto.go

41 lines
1.5 KiB
Go
Raw Normal View History

package usecase
import (
"gateway/internal/model/notification/domain/enum"
)
// SendRequest is the input for NotifierUseCase.Send / Enqueue.
type SendRequest struct {
TenantID string
UID string
Channel enum.Channel
Kind enum.NotifyKind
Target string
Locale string
Data map[string]any
Severity enum.Severity
IdempotencyKey string
DoNotPersistBody bool
}
// NotificationDTO is the API-facing notification record (no raw target).
type NotificationDTO struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
UID string `json:"uid,omitempty"`
Channel enum.Channel `json:"channel"`
Kind enum.NotifyKind `json:"kind"`
TargetHash string `json:"target_hash"`
TemplateKey string `json:"template_key"`
Locale string `json:"locale"`
Provider string `json:"provider,omitempty"`
ProviderMessageID string `json:"provider_message_id,omitempty"`
Status enum.NotifyStatus `json:"status"`
Attempts int `json:"attempts"`
LastError string `json:"last_error,omitempty"`
IdempotencyKey string `json:"idempotency_key"`
Severity enum.Severity `json:"severity"`
OccurredAt int64 `json:"occurred_at"`
DeliveredAt int64 `json:"delivered_at,omitempty"`
}