first commit
This commit is contained in:
39
internal/webhook/model.go
Normal file
39
internal/webhook/model.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package webhook
|
||||
|
||||
import "time"
|
||||
|
||||
type EventType string
|
||||
|
||||
const (
|
||||
EventUserPaid EventType = "user.paid"
|
||||
EventUserAdded EventType = "user.added"
|
||||
EventUserExtended EventType = "user.extended"
|
||||
EventUserRemoved EventType = "user.removed"
|
||||
)
|
||||
|
||||
type Status string
|
||||
|
||||
const (
|
||||
StatusPending Status = "pending"
|
||||
StatusDelivered Status = "delivered"
|
||||
StatusDead Status = "dead"
|
||||
)
|
||||
|
||||
type Payload struct {
|
||||
Event EventType `json:"event"`
|
||||
Timestamp string `json:"timestamp"`
|
||||
Domain string `json:"domain"`
|
||||
Data map[string]any `json:"data"`
|
||||
}
|
||||
|
||||
type OutboxItem struct {
|
||||
ID int64
|
||||
EventType EventType
|
||||
Payload string
|
||||
Attempts int
|
||||
LastAttemptAt *time.Time
|
||||
NextAttemptAt time.Time
|
||||
Status Status
|
||||
LastError string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
Reference in New Issue
Block a user