refactored payment orchestration

This commit is contained in:
Stephan D
2026-02-03 00:40:46 +01:00
parent 05d998e0f7
commit 5e87e2f2f9
184 changed files with 3920 additions and 2219 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/tech/sendico/pkg/ledgerconv"
"github.com/tech/sendico/pkg/merrors"
"github.com/tech/sendico/pkg/model"
"github.com/tech/sendico/pkg/model/account_role"
"github.com/tech/sendico/pkg/mservice"
describablev1 "github.com/tech/sendico/pkg/proto/common/describable/v1"
ledgerv1 "github.com/tech/sendico/pkg/proto/ledger/v1"
@@ -132,7 +133,7 @@ func mapLedgerAccountType(accountType srequest.LedgerAccountType) (ledgerv1.Acco
return parsed, nil
}
func mapLedgerAccountRole(role model.AccountRole) (ledgerv1.AccountRole, error) {
func mapLedgerAccountRole(role account_role.AccountRole) (ledgerv1.AccountRole, error) {
raw := strings.TrimSpace(string(role))
if ledgerconv.IsAccountRoleUnspecified(raw) {
return ledgerv1.AccountRole_ACCOUNT_ROLE_OPERATING, nil

View File

@@ -3,8 +3,9 @@ package paymentapiimp
import (
"strings"
"github.com/google/uuid"
"github.com/tech/sendico/pkg/merrors"
"github.com/tech/sendico/pkg/model"
paymenttypes "github.com/tech/sendico/pkg/payments/types"
fxv1 "github.com/tech/sendico/pkg/proto/common/fx/v1"
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
chainv1 "github.com/tech/sendico/pkg/proto/gateway/chain/v1"
@@ -46,6 +47,7 @@ func mapPaymentIntent(intent *srequest.PaymentIntent) (*orchestratorv1.PaymentIn
}
return &orchestratorv1.PaymentIntent{
Ref: uuid.New().String(),
Kind: kind,
Source: source,
Destination: destination,
@@ -225,7 +227,7 @@ func mapAsset(asset *srequest.Asset) (*chainv1.Asset, error) {
}, nil
}
func mapMoney(m *model.Money) *moneyv1.Money {
func mapMoney(m *paymenttypes.Money) *moneyv1.Money {
if m == nil {
return nil
}