package domain

import (
	"context"
	"time"
)

type WebhookLog struct {
	ID          int64      `json:"id"`
	Source      string     `json:"source"`
	EventType   *string    `json:"event_type"`
	Payload     any        `json:"payload"`
	Headers     any        `json:"headers"`
	IsProcessed bool       `json:"is_processed"`
	ProcessedAt *time.Time `json:"processed_at"`
	CreatedAt   time.Time  `json:"created_at"`
}

type WebhookRepository interface {
	Create(ctx context.Context, log *WebhookLog) error
	GetUnprocessed(ctx context.Context) ([]WebhookLog, error)
	MarkAsProcessed(ctx context.Context, id int64) error
}
