Skip to content

Commit

Permalink
Merge pull request #370 from nofrixion/MOOV-3405-Return-Rule-Details-…
Browse files Browse the repository at this point in the history
…In-Payout-And-Transaction-Models

Return rule details in payout and transaction models.
  • Loading branch information
sauravmaiti22 authored Jul 4, 2024
2 parents b6e586e + 3be0d88 commit 1ee3761
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ public Counterparty? DestinationAccount
/// </summary>
public List<PayoutEvent>? Events { get; set; }

/// <summary>
/// Details of the rule that triggered the payout.
/// </summary>
public RuleMinimal? Rule { get; set; }

public NoFrixionProblem Validate()
{
var context = new ValidationContext(this, serviceProvider: null, items: null);
Expand Down
23 changes: 23 additions & 0 deletions src/NoFrixion.MoneyMoov/Models/Rules/RuleMinimal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// -----------------------------------------------------------------------------
// Filename: RuleMinimal.cs
//
// Description: Minimal representation of a rule.
//
// Author(s):
// Saurav Maiti ([email protected])
//
// History:
// 04 07 2024 Saurav Maiti Created, Harcourt Street, Dublin, Ireland.
//
// License:
// MIT.
// -----------------------------------------------------------------------------

namespace NoFrixion.MoneyMoov.Models;

public class RuleMinimal
{
public Guid ID { get; set; }

public string Name { get; set; } = string.Empty;
}
5 changes: 5 additions & 0 deletions src/NoFrixion.MoneyMoov/Models/Transaction/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,9 @@ public class Transaction : IWebhookPayload
/// Balance left on the account after the transaction.
/// </summary>
public decimal Balance { get; set; }

/// <summary>
/// ID of the rule that resulted in the transaction.
/// </summary>
public Guid? RuleID { get; set; }
}

0 comments on commit 1ee3761

Please sign in to comment.