Skip to content

Commit 47bbcda

Browse files
committed
Merge branch 'release/moov-1.8.88'
2 parents 8227ad6 + 875bf53 commit 47bbcda

File tree

5 files changed

+28
-8
lines changed

5 files changed

+28
-8
lines changed

src/NoFrixion.MoneyMoov/Models/Account/AccountIdentifier.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ public string BitcoinAddress
175175
"No identifier.";
176176

177177
public string DisplayScanSummary =>
178-
Currency == CurrencyTypeEnum.GBP && !string.IsNullOrEmpty(SortCode) && !string.IsNullOrEmpty(AccountNumber) && SortCode.Length == GBP_SORT_CODE_LENGTH
179-
? $"{SortCode[..2]}-{SortCode.Substring(2, 2)}-{SortCode.Substring(4, 2)} {AccountNumber}"
180-
: $"{SortCode} {AccountNumber}";
178+
!string.IsNullOrEmpty(SortCode) && !string.IsNullOrEmpty(AccountNumber) && SortCode.Length == GBP_SORT_CODE_LENGTH
179+
? $"{SortCode[..2]}-{SortCode[2..4]}-{SortCode[4..6]} / {AccountNumber}"
180+
: $"{SortCode} / {AccountNumber}";
181181

182-
public string DisplayBicSummary => $"{BIC} {AccountNumber}";
182+
public string DisplayBicSummary => $"{BIC} / {AccountNumber}";
183183

184184
public bool IsSameDestination(AccountIdentifier other)
185185
{

src/NoFrixion.MoneyMoov/Models/Beneficiary/Beneficiary.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ public class Beneficiary : IValidatableObject, IExportableToCsv
112112
public DateTimeOffset? LastAuthorised { get; set; }
113113

114114
public User CreatedBy { get; set; }
115+
116+
/// <summary>
117+
/// The reference that will be used by default as TheirReference when creating payouts to this beneficiary
118+
/// if no TheirReference is specified for the payout.
119+
/// </summary>
120+
[CanBeNull] public string TheirReference { get; set; }
115121

116122
// Don't serialize the events if there are none.
117123
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull)]

src/NoFrixion.MoneyMoov/Models/Beneficiary/BeneficiaryCreate.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// -----------------------------------------------------------------------------
1616

1717
using System.ComponentModel.DataAnnotations;
18+
using JetBrains.Annotations;
1819

1920
#nullable disable
2021

@@ -46,14 +47,20 @@ public class BeneficiaryCreate : IValidatableObject
4647

4748
[Required(ErrorMessage = "Destination is required.")]
4849
public CounterpartyCreate Destination { get; set; }
50+
51+
/// <summary>
52+
/// Optional reference that will be used by default as TheirReference when creating payouts to this beneficiary
53+
/// if no TheirReference is specified for the payout.
54+
/// </summary>
55+
[CanBeNull] public string TheirReference { get; set; }
4956

5057
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
5158
{
5259
var payout = ToPayout();
5360
payout.Amount = 0.01M;
5461
// Use dummy valid values for references. Beneficiaries can have invalid references as
5562
// they will be forced to fix them when the payout is created.
56-
payout.TheirReference = "GoodRef";
63+
payout.TheirReference = TheirReference ?? "GoodRef";
5764
payout.YourReference = "GoodRef";
5865
return payout.Validate(validationContext);
5966
}
@@ -91,7 +98,8 @@ public Dictionary<string, string> ToDictionary()
9198
{ nameof(ID), ID.ToString() },
9299
{ nameof(MerchantID), MerchantID.ToString() },
93100
{ nameof(Name), Name },
94-
{ nameof(Currency), Currency.ToString() }
101+
{ nameof(Currency), Currency.ToString() },
102+
{ nameof(TheirReference), TheirReference}
95103
};
96104

97105
if (Destination != null)

src/NoFrixion.MoneyMoov/Models/Beneficiary/BeneficiaryUpdate.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ public class BeneficiaryUpdate
3333

3434
public Counterparty? Destination { get; set; }
3535

36+
/// <summary>
37+
/// The default reference that will be used by default as TheirReference when creating payouts to this beneficiary
38+
/// if no TheirReference is specified for the payout.
39+
/// </summary>
40+
public string? TheirReference { get; set; }
41+
3642
public NoFrixionProblem Validate()
3743
{
3844
var context = new ValidationContext(this, serviceProvider: null, items: null);

src/NoFrixion.MoneyMoov/NoFrixion.MoneyMoov.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<AssemblyVersion>1.8.84.0</AssemblyVersion>
8-
<FileVersion>1.8.84.0</FileVersion>
7+
<AssemblyVersion>1.8.88.0</AssemblyVersion>
8+
<FileVersion>1.8.88.0</FileVersion>
99
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1010
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
1111
<NoWarn>$(NoWarn);1591;NU1902;NU1903;</NoWarn>

0 commit comments

Comments
 (0)