propagated payment commentto bff

This commit is contained in:
Stephan D
2026-03-12 00:42:49 +01:00
parent 4958bdb500
commit b440df97d5
94 changed files with 626 additions and 119 deletions

View File

@@ -32,6 +32,7 @@ func modelIntentFromQuoteIntent(src *transfer_intent_hydrator.QuoteIntent) model
Source: modelEndpointFromQuoteEndpoint(src.Source),
Destination: modelEndpointFromQuoteEndpoint(src.Destination),
Amount: cloneModelMoney(src.Amount),
Comment: strings.TrimSpace(src.Comment),
FX: fxIntentFromHydratedIntent(src),
RequiresFX: src.RequiresFX,
Attributes: cloneStringMap(src.Attributes),

View File

@@ -149,9 +149,6 @@ func (h *TransferIntentHydrator) HydrateOne(ctx context.Context, in HydrateOneIn
"initiator_ref": strings.TrimSpace(in.InitiatorRef),
},
}
if intent.Comment != "" {
intent.Attributes["comment"] = intent.Comment
}
return intent, nil
}

View File

@@ -99,6 +99,12 @@ func TestHydrateOne_SuccessWithInlineMethods(t *testing.T) {
if got.Amount == nil || got.Amount.Amount != "10.25" {
t.Fatalf("unexpected amount: %#v", got.Amount)
}
if got.Comment != "transfer note" {
t.Fatalf("unexpected comment: got=%q", got.Comment)
}
if _, ok := got.Attributes["comment"]; ok {
t.Fatalf("comment must not be persisted in attributes")
}
}
func TestHydrateOne_PropagatesFXIntent(t *testing.T) {