package app import ( "context" "fmt" "gitea.nik4nao.com/nik/home-services/alert-bridge/internal/core/domain" "gitea.nik4nao.com/nik/home-services/alert-bridge/internal/core/ports/driven" ) // AlertApp orchestrates delivering an incoming alert to its Notifier. type AlertApp struct { notifier driven.Notifier } // NewAlertApp constructs the alert application service. func NewAlertApp(notifier driven.Notifier) *AlertApp { return &AlertApp{notifier: notifier} } // Handle delivers one alert, wrapping any delivery failure for the caller. func (a *AlertApp) Handle(ctx context.Context, alert domain.Alert) error { if err := a.notifier.Notify(ctx, alert); err != nil { return fmt.Errorf("notify: %w", err) } return nil }