Files
sendico/api/edge/bff/internal/server/recipientimp/notifications.go
2026-02-28 00:39:20 +01:00

23 lines
613 B
Go

package recipientimp
import (
messaging "github.com/tech/sendico/pkg/messaging/envelope"
notifications "github.com/tech/sendico/pkg/messaging/notifications/object"
"github.com/tech/sendico/pkg/model"
nm "github.com/tech/sendico/pkg/model/notification"
"go.mongodb.org/mongo-driver/v2/bson"
)
func (a *RecipientAPI) notification(
recipient *model.Recipient,
actorAccountRef bson.ObjectID,
t nm.NotificationAction,
) messaging.Envelope {
objectRef := bson.NilObjectID
if recipient != nil {
objectRef = recipient.ID
}
return notifications.Object(a.Name(), actorAccountRef, a.Name(), objectRef, t)
}