nidus-sync/platform/text/job.go
Eli Ribble 9914274d42
Wire in agent to the reporter texting system
Also rework the so the platform absorbs all the business logic that was
going in the wrong place.
2026-01-27 19:56:26 +00:00

39 lines
714 B
Go

package text
import (
"context"
"github.com/rs/zerolog/log"
)
type MessageType int
const (
ReportSubscription MessageType = iota
)
type Job interface {
content() string
destination() string
messageType() MessageType
messageTypeName() string
source() string
}
func Handle(ctx context.Context, job Job) {
var err error
switch job.messageType() {
case ReportSubscription:
err = sendReportSubscription(ctx, job)
}
if err != nil {
log.Error().Err(err).Str("dest", job.destination()).Str("type", string(job.messageTypeName())).Msg("Error processing email")
return
}
/*
case enums.CommsMessagetypeemailReportStatusScheduled:
case enums.CommsMessagetypeemailReportStatusComplete:
}
*/
}