Documentation
¶
Overview ¶
Package worker starts the background job runner and registers all job handlers.
Index ¶
Constants ¶
View Source
const ( JobAccounting = "accounting" JobEmailReceipt = "email_receipt" JobStockAlert = "stock_alert" )
Job name constants — must match handler registrations in NewRunner.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountingPayload ¶
type AccountingPayload struct {
EventName string `json:"event_name"`
Payload map[string]any `json:"payload"`
}
AccountingPayload is the job body for accounting journal creation (Phase 8).
type EmailReceiptPayload ¶
type EmailReceiptPayload struct {
OrderID string `json:"order_id"`
CompanyID string `json:"company_id"`
ReceiptNumber string `json:"receipt_number"`
Total int64 `json:"total"`
}
EmailReceiptPayload carries the minimum order info needed to send a receipt.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner wraps a goqite jobs.Runner with all registered job handlers.
func NewRunner ¶
func NewRunner( q *goqite.Queue, log *slog.Logger, accountingSvc *accounting.Service, registry *plugin.Registry, ) *Runner
NewRunner creates a Runner with all job handlers registered. accountingSvc may be nil when the accounting repo is not configured (tests). registry may be nil if no plugin directory is configured.
Click to show internal directories.
Click to hide internal directories.