new settlement flow

This commit is contained in:
Stephan D
2026-01-20 22:29:30 +01:00
parent ae6c617136
commit e0d7320fad
42 changed files with 428 additions and 73 deletions

View File

@@ -0,0 +1,38 @@
package notifications
import (
"encoding/json"
messaging "github.com/tech/sendico/pkg/messaging/envelope"
"github.com/tech/sendico/pkg/model"
nm "github.com/tech/sendico/pkg/model/notification"
"github.com/tech/sendico/pkg/mservice"
)
type TelegramReactionNotification struct {
messaging.Envelope
payload model.TelegramReactionRequest
}
func (trn *TelegramReactionNotification) Serialize() ([]byte, error) {
data, err := json.Marshal(trn.payload)
if err != nil {
return nil, err
}
return trn.Envelope.Wrap(data)
}
func telegramReactionEvent() model.NotificationEvent {
return model.NewNotification(mservice.Notifications, nm.NATelegramReaction)
}
func NewTelegramReactionEnvelope(sender string, request *model.TelegramReactionRequest) messaging.Envelope {
var payload model.TelegramReactionRequest
if request != nil {
payload = *request
}
return &TelegramReactionNotification{
Envelope: messaging.CreateEnvelope(sender, telegramReactionEvent()),
payload: payload,
}
}