move api/server to api/edge/bff
This commit is contained in:
22
api/edge/bff/internal/server/recipientimp/notifications.go
Normal file
22
api/edge/bff/internal/server/recipientimp/notifications.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user