Skip to content

Commit 850b285

Browse files
committed
Merge branch 'release/moov-1.8.98'
2 parents 141cc50 + 245a90a commit 850b285

File tree

6 files changed

+70
-37
lines changed

6 files changed

+70
-37
lines changed

src/NoFrixion.MoneyMoov/Enums/AuthorisationType.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ public enum AuthorisationType
2323
Beneficiary = 3,
2424
Payrun = 4,
2525
MerchantToken = 5,
26-
UserInvite = 6
26+
UserInvite = 6,
27+
RoleUser = 7
2728
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//-----------------------------------------------------------------------------
2+
// Filename: RoleUserEventTypeEnum.cs
3+
//
4+
// Description: Enum for the different types of role user (assigning a user to a role)
5+
// events that can occur.
6+
//
7+
// Author(s):
8+
// Aaron Clauson ([email protected])
9+
//
10+
// History:
11+
// 22 Aug 2025 Aaron Clauson Created, Stillorgan Wood, Dublin, Ireland.
12+
//
13+
// License:
14+
// MIT.
15+
//-----------------------------------------------------------------------------
16+
17+
namespace NoFrixion.MoneyMoov.Enums;
18+
19+
public enum RoleUserEventTypeEnum
20+
{
21+
/// <summary>
22+
/// Something went wrong and the event type is unknown.
23+
/// </summary>
24+
Unknown = 0,
25+
26+
/// <summary>
27+
/// A user invite was authorised.
28+
/// </summary>
29+
Authorise = 1
30+
}

src/NoFrixion.MoneyMoov/Models/Roles/RoleUser.cs

100644100755
Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// History:
1010
// 19 08 2024 Donal O'Connor Created, Harcourt St, Dublin, Ireland.
11+
// 22 08 2025 Aaron Clauson Added GetApprovalHash for role user authorisatoions.
1112
//
1213
// License:
1314
// Proprietary NoFrixion.
@@ -36,9 +37,30 @@ public class RoleUser
3637

3738
public List<RoleUserAccount>? Accounts { get; set; }
3839

39-
public List<RoleUserMerchant>? Merchants { get; set; }
40-
4140
public User? User { get; set; }
4241

43-
public Role? Role { get; set; }
42+
public Role? Role { get; set; }
43+
44+
/// <summary>
45+
/// Gets a hash of the critical fields for the role user. This hash is
46+
/// used to ensure a role user's details are not modified between the time the
47+
/// authorisation is given and the time the role user assignment is enabled.
48+
/// Note the authorisation logic is currently only for the initial role user assignment.
49+
/// It is not intended to cover subsequent updates to the list of accounts the user gets access to
50+
/// for the role. In other words, once a user has been authorised for a role for a merchant they
51+
/// do not need to be re-authorised if the list of accounts changes. Because of this there is no
52+
/// nonce required in the approval hash as it does not need to accommodate updates.
53+
/// </summary>
54+
/// <returns>A hash of the role user's critical fields.</returns>
55+
public string GetApprovalHash()
56+
{
57+
var input =
58+
RoleID.ToString("N") +
59+
UserID.ToString("N") +
60+
(Accounts != null
61+
? string.Join(",", Accounts.OrderBy(a => a.AccountID).Select(a => a.AccountID.ToString("N")))
62+
: string.Empty);
63+
64+
return HashHelper.CreateHash(input);
65+
}
4466
}

src/NoFrixion.MoneyMoov/Models/Roles/RoleUserMerchant.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/NoFrixion.MoneyMoov/Models/Statement/StatementHeader.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,15 @@ public class StatementHeader
8888
public IEnumerable<Transaction> Transactions { get; set; }
8989

9090
public bool IsTrustAccount { get; set; }
91+
92+
/// <summary>
93+
/// Date and time when the statement was generated.
94+
/// This will take into account the merchant's timezone.
95+
/// </summary>
96+
public DateTime GeneratedOn { get; set; }
97+
98+
/// <summary>
99+
/// The timezone used to generate the statement.
100+
/// </summary>
101+
public TimeZoneInfo GeneratedOnTimeZone { get; set; }
91102
}

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.97.0</AssemblyVersion>
8-
<FileVersion>1.8.97.0</FileVersion>
7+
<AssemblyVersion>1.8.98.0</AssemblyVersion>
8+
<FileVersion>1.8.98.0</FileVersion>
99
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1010
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
1111
<NoWarn>$(NoWarn);1591;NU1902;NU1903;</NoWarn>

0 commit comments

Comments
 (0)