Moved cursor to a separate file

This commit is contained in:
Stephan D
2026-02-13 00:23:39 +01:00
parent fd1f5498b4
commit 16c44ec7d3
5 changed files with 33 additions and 21 deletions

View File

@@ -16,6 +16,7 @@ import (
"github.com/tech/sendico/pkg/mlogger"
"github.com/tech/sendico/pkg/model"
"github.com/tech/sendico/pkg/mservice"
paginationv2 "github.com/tech/sendico/pkg/proto/common/pagination/v2"
methodsv1 "github.com/tech/sendico/pkg/proto/payments/methods/v1"
eapi "github.com/tech/sendico/server/interface/api"
"github.com/tech/sendico/server/interface/api/sresponse"
@@ -274,12 +275,12 @@ func resolveClientAddress(service string, cfg *eapi.PaymentOrchestratorConfig) (
return "", merrors.InvalidArgument(strings.TrimSpace(service) + " address is not specified")
}
func toProtoCursor(cursor *model.ViewCursor) *methodsv1.ViewCursor {
func toProtoCursor(cursor *model.ViewCursor) *paginationv2.ViewCursor {
if cursor == nil {
return nil
}
res := &methodsv1.ViewCursor{}
res := &paginationv2.ViewCursor{}
hasAny := false
if cursor.Limit != nil {
res.Limit = wrapperspb.Int64(*cursor.Limit)