package notifications

import (
	messaging "github.com/tech/sendico/pkg/messaging/envelope"
	cinternal "github.com/tech/sendico/pkg/messaging/internal/notifications/confirmations"
	ch "github.com/tech/sendico/pkg/messaging/notifications/confirmations/handler"
	np "github.com/tech/sendico/pkg/messaging/notifications/processor"
	"github.com/tech/sendico/pkg/mlogger"
	"github.com/tech/sendico/pkg/model"
)

func ConfirmationRequest(sender string, request *model.ConfirmationRequest) messaging.Envelope {
	return cinternal.NewConfirmationRequestEnvelope(sender, request)
}

func ConfirmationResult(sender string, result *model.ConfirmationResult, sourceService, rail string) messaging.Envelope {
	return cinternal.NewConfirmationResultEnvelope(sender, result, sourceService, rail)
}

func ConfirmationDispatch(sender string, dispatch *model.ConfirmationRequestDispatch, sourceService, rail string) messaging.Envelope {
	return cinternal.NewConfirmationDispatchEnvelope(sender, dispatch, sourceService, rail)
}

func NewConfirmationRequestProcessor(logger mlogger.Logger, handler ch.ConfirmationRequestHandler) np.EnvelopeProcessor {
	return cinternal.NewConfirmationRequestProcessor(logger, handler)
}

func NewConfirmationResultProcessor(logger mlogger.Logger, sourceService, rail string, handler ch.ConfirmationResultHandler) np.EnvelopeProcessor {
	return cinternal.NewConfirmationResultProcessor(logger, sourceService, rail, handler)
}

func NewConfirmationDispatchProcessor(logger mlogger.Logger, sourceService, rail string, handler ch.ConfirmationDispatchHandler) np.EnvelopeProcessor {
	return cinternal.NewConfirmationDispatchProcessor(logger, sourceService, rail, handler)
}
