Skip to content

Commit 8850ac9

Browse files
authored
Add payout properties for FxQuoteID. (#615)
1 parent 03a0fc4 commit 8850ac9

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,17 @@ public Counterparty? DestinationAccount
502502
/// </summary>
503503
public string FormattedFxDestinationAmount => PaymentAmount.DisplayCurrencyAndAmount(FxDestinationCurrency.GetValueOrDefault(), FxDestinationAmount.GetValueOrDefault());
504504

505+
/// <summary>
506+
/// Optional. For multi-currency payouts this is the ID of the held rate that was set for the FX conversion. If
507+
/// empty it indicates the mid-market FX rate is being be used.
508+
/// </summary>
509+
public string? FxQuoteID { get; set; }
510+
511+
/// <summary>
512+
/// If an FX held rate quote ID is being used this is the time the quote expires.
513+
/// </summary>
514+
public DateTimeOffset? FxQuoteExpiresAt { get; set; }
515+
505516
public NoFrixionProblem Validate()
506517
{
507518
var context = new ValidationContext(this, serviceProvider: null, items: null);

src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@ public Guid? BeneficiaryID
234234
/// </summary>
235235
public bool FxUseDestinationAmount { get; set; }
236236

237+
/// <summary>
238+
/// Optional. For multi-currency payouts this is the ID of a held rate that can be used for the FX conversion. If left
239+
/// empty the mid-market FX rate will be used.
240+
/// </summary>
241+
public string? FxQuoteID { get; set; }
242+
237243
/// <summary>
238244
/// Places all the payout's properties into a dictionary.
239245
/// </summary>
@@ -266,6 +272,7 @@ public Dictionary<string, string> ToDictionary()
266272
if (Amount != null) dict.Add(nameof(Amount), Amount.Value.ToString());
267273
if (FxDestinationCurrency != null) dict.Add(nameof(FxDestinationCurrency), FxDestinationCurrency.Value.ToString());
268274
if (FxDestinationAmount != null) dict.Add(nameof(FxDestinationAmount), FxDestinationAmount.Value.ToString());
275+
if (!string.IsNullOrWhiteSpace(FxQuoteID)) dict.Add(nameof(FxQuoteID), FxQuoteID);
269276

270277
return dict;
271278
}

src/NoFrixion.MoneyMoov/Models/Payouts/PayoutUpdate.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ public Guid? BeneficiaryID
207207
/// </summary>
208208
public bool? FxUseDestinationAmount { get; set; }
209209

210+
/// <summary>
211+
/// Optional. For multi-currency payouts this is the ID of a held rate that can be used for the FX conversion. If left
212+
/// empty the mid-market FX rate will be used.
213+
/// </summary>
214+
public string? FxQuoteID { get; set; }
215+
210216
/// <summary>
211217
/// Places all the payout's properties into a dictionary.
212218
/// </summary>
@@ -228,6 +234,7 @@ public Dictionary<string, string> ToDictionary()
228234
if (FxDestinationCurrency != null) dict.Add(nameof(FxDestinationCurrency), FxDestinationCurrency.Value.ToString());
229235
if (FxDestinationAmount != null) dict.Add(nameof(FxDestinationAmount), FxDestinationAmount.Value.ToString());
230236
if (FxUseDestinationAmount != null) dict.Add(nameof(FxUseDestinationAmount), FxUseDestinationAmount.Value.ToString());
237+
if (!string.IsNullOrWhiteSpace(FxQuoteID)) dict.Add(nameof(FxQuoteID), FxQuoteID);
231238

232239
if (Destination != null)
233240
{

0 commit comments

Comments
 (0)