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

@@ -27,16 +27,6 @@ type ConfirmationResult struct {
RequestID string `bson:"requestId,omitempty" json:"request_id,omitempty"`
Money *paymenttypes.Money `bson:"money,omitempty" json:"money,omitempty"`
RawReply *TelegramMessage `bson:"rawReply,omitempty" json:"raw_reply,omitempty"`
Status ConfirmationStatus `bson:"status,omitempty" json:"status,omitempty"`
Status ConfirmationStatus `bson:"status,omitempty" json:"status,omitempty"`
ParseError string `bson:"parseError,omitempty" json:"parse_error,omitempty"`
}
type TelegramMessage struct {
ChatID string `bson:"chatId,omitempty" json:"chat_id,omitempty"`
MessageID string `bson:"messageId,omitempty" json:"message_id,omitempty"`
ReplyToMessageID string `bson:"replyToMessageId,omitempty" json:"reply_to_message_id,omitempty"`
FromUserID string `bson:"fromUserId,omitempty" json:"from_user_id,omitempty"`
FromUsername string `bson:"fromUsername,omitempty" json:"from_username,omitempty"`
Text string `bson:"text,omitempty" json:"text,omitempty"`
SentAt int64 `bson:"sentAt,omitempty" json:"sent_at,omitempty"`
}

View File

@@ -63,7 +63,7 @@ func FromStringImp(s string) (*NotificationEventImp, error) {
func StringToNotificationAction(s string) (nm.NotificationAction, error) {
switch nm.NotificationAction(s) {
case nm.NACreated, nm.NAPending, nm.NAUpdated, nm.NADeleted, nm.NAAssigned, nm.NAPasswordReset:
case nm.NACreated, nm.NAPending, nm.NAUpdated, nm.NADeleted, nm.NAAssigned, nm.NAPasswordReset, nm.NAConfirmationRequest, nm.NATelegramReaction, nm.NAPaymentGatewayIntent, nm.NAPaymentGatewayExecution, nm.NADiscoveryServiceAnnounce, nm.NADiscoveryGatewayAnnounce, nm.NADiscoveryHeartbeat, nm.NADiscoveryLookupRequest, nm.NADiscoveryLookupResponse, nm.NADiscoveryRefreshUI:
return nm.NotificationAction(s), nil
default:
return "", merrors.DataConflict("invalid Notification action: " + s)

View File

@@ -12,8 +12,9 @@ const (
NASent NotificationAction = "sent"
NAPasswordReset NotificationAction = "password_reset"
NAConfirmationRequest NotificationAction = "confirmation.request"
NAPaymentGatewayIntent NotificationAction = "intent.request"
NAConfirmationRequest NotificationAction = "confirmation.request"
NATelegramReaction NotificationAction = "telegram.reaction"
NAPaymentGatewayIntent NotificationAction = "intent.request"
NAPaymentGatewayExecution NotificationAction = "execution.result"
NADiscoveryServiceAnnounce NotificationAction = "service.announce"

View File

@@ -82,6 +82,7 @@ func StringToNotificationAction(s string) (nm.NotificationAction, error) {
nm.NAAssigned,
nm.NAPasswordReset,
nm.NAConfirmationRequest,
nm.NATelegramReaction,
nm.NAPaymentGatewayIntent,
nm.NAPaymentGatewayExecution,
nm.NADiscoveryServiceAnnounce,

18
api/pkg/model/telegram.go Normal file
View File

@@ -0,0 +1,18 @@
package model
type TelegramMessage struct {
ChatID string `bson:"chatId,omitempty" json:"chat_id,omitempty"`
MessageID string `bson:"messageId,omitempty" json:"message_id,omitempty"`
ReplyToMessageID string `bson:"replyToMessageId,omitempty" json:"reply_to_message_id,omitempty"`
FromUserID string `bson:"fromUserId,omitempty" json:"from_user_id,omitempty"`
FromUsername string `bson:"fromUsername,omitempty" json:"from_username,omitempty"`
Text string `bson:"text,omitempty" json:"text,omitempty"`
SentAt int64 `bson:"sentAt,omitempty" json:"sent_at,omitempty"`
}
type TelegramReactionRequest struct {
RequestID string `bson:"requestId,omitempty" json:"request_id,omitempty"`
ChatID string `bson:"chatId,omitempty" json:"chat_id,omitempty"`
MessageID string `bson:"messageId,omitempty" json:"message_id,omitempty"`
Emoji string `bson:"emoji,omitempty" json:"emoji,omitempty"`
}