propagated payment commentto bff
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user