refactored notificatoin / tgsettle responsibility boundaries
This commit is contained in:
@@ -2,6 +2,7 @@ package storage
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/tech/sendico/gateway/tgsettle/storage/model"
|
||||
"github.com/tech/sendico/pkg/merrors"
|
||||
@@ -12,6 +13,7 @@ var ErrDuplicate = merrors.DataConflict("payment gateway storage: duplicate reco
|
||||
type Repository interface {
|
||||
Payments() PaymentsStore
|
||||
TelegramConfirmations() TelegramConfirmationsStore
|
||||
PendingConfirmations() PendingConfirmationsStore
|
||||
}
|
||||
|
||||
type PaymentsStore interface {
|
||||
@@ -22,3 +24,13 @@ type PaymentsStore interface {
|
||||
type TelegramConfirmationsStore interface {
|
||||
Upsert(ctx context.Context, record *model.TelegramConfirmation) error
|
||||
}
|
||||
|
||||
type PendingConfirmationsStore interface {
|
||||
Upsert(ctx context.Context, record *model.PendingConfirmation) error
|
||||
FindByRequestID(ctx context.Context, requestID string) (*model.PendingConfirmation, error)
|
||||
FindByMessageID(ctx context.Context, messageID string) (*model.PendingConfirmation, error)
|
||||
MarkClarified(ctx context.Context, requestID string) error
|
||||
AttachMessage(ctx context.Context, requestID string, messageID string) error
|
||||
DeleteByRequestID(ctx context.Context, requestID string) error
|
||||
ListExpired(ctx context.Context, now time.Time, limit int64) ([]*model.PendingConfirmation, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user