Files
sendico/api/pkg/model/confirmation.go
2026-01-04 12:57:40 +01:00

43 lines
2.3 KiB
Go

package model
import paymenttypes "github.com/tech/sendico/pkg/payments/types"
type ConfirmationStatus string
const (
ConfirmationStatusConfirmed ConfirmationStatus = "CONFIRMED"
ConfirmationStatusClarified ConfirmationStatus = "CLARIFIED"
ConfirmationStatusTimeout ConfirmationStatus = "TIMEOUT"
ConfirmationStatusRejected ConfirmationStatus = "REJECTED"
)
type ConfirmationRequest struct {
RequestID string `bson:"requestId,omitempty" json:"request_id,omitempty"`
TargetChatID string `bson:"targetChatId,omitempty" json:"target_chat_id,omitempty"`
RequestedMoney *paymenttypes.Money `bson:"requestedMoney,omitempty" json:"requested_money,omitempty"`
PaymentIntentID string `bson:"paymentIntentId,omitempty" json:"payment_intent_id,omitempty"`
QuoteRef string `bson:"quoteRef,omitempty" json:"quote_ref,omitempty"`
AcceptedUserIDs []string `bson:"acceptedUserIds,omitempty" json:"accepted_user_ids,omitempty"`
TimeoutSeconds int32 `bson:"timeoutSeconds,omitempty" json:"timeout_seconds,omitempty"`
SourceService string `bson:"sourceService,omitempty" json:"source_service,omitempty"`
Rail string `bson:"rail,omitempty" json:"rail,omitempty"`
}
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"`
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"`
}