fixed rail & operation names

This commit is contained in:
Stephan D
2026-02-27 02:33:40 +01:00
parent 82cf91e703
commit 747153bdbf
73 changed files with 877 additions and 667 deletions

View File

@@ -8,12 +8,15 @@ import (
"github.com/tech/sendico/gateway/tgsettle/storage"
storagemodel "github.com/tech/sendico/gateway/tgsettle/storage/model"
"github.com/tech/sendico/pkg/discovery"
envelope "github.com/tech/sendico/pkg/messaging/envelope"
tnotifications "github.com/tech/sendico/pkg/messaging/notifications/telegram"
mloggerfactory "github.com/tech/sendico/pkg/mlogger/factory"
"github.com/tech/sendico/pkg/model"
"github.com/tech/sendico/pkg/mservice"
paymenttypes "github.com/tech/sendico/pkg/payments/types"
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
chainv1 "github.com/tech/sendico/pkg/proto/gateway/chain/v1"
)
//
@@ -370,3 +373,22 @@ func TestTimeout(t *testing.T) {
t.Fatalf("timeout must not publish reaction")
}
}
func TestIntentFromSubmitTransfer_NormalizesOutgoingLeg(t *testing.T) {
intent, err := intentFromSubmitTransfer(&chainv1.SubmitTransferRequest{
IdempotencyKey: "idem-5",
IntentRef: "pi-5",
OperationRef: "op-5",
PaymentRef: "pay-5",
Amount: &moneyv1.Money{Amount: "10", Currency: "USD"},
Metadata: map[string]string{
metadataOutgoingLeg: "card_payout",
},
}, "provider_settlement", "")
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if got, want := intent.OutgoingLeg, discovery.RailCardPayout; got != want {
t.Fatalf("unexpected outgoing leg: got=%q want=%q", got, want)
}
}