Skip to content

Commit 7562bd7

Browse files
authored
Merge pull request #472 from nofrixion/feature/MOOV-3952-payout-documents
MOOV-3952: Add PayoutDocuments collection props
2 parents 1da599d + 8761c53 commit 7562bd7

File tree

5 files changed

+143
-0
lines changed

5 files changed

+143
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// -----------------------------------------------------------------------------
2+
// Filename: PayoutDocumentTypesEnum.cs
3+
//
4+
// Description: Enum for the different types of payout documents.
5+
//
6+
// Author(s):
7+
// Axel Granillo ([email protected])
8+
//
9+
// History:
10+
// 28 11 2024 Axel Granillo Created, Remote, Mexico City, Mexico.
11+
//
12+
// License:
13+
// MIT.
14+
// -----------------------------------------------------------------------------
15+
16+
namespace NoFrixion.MoneyMoov.Enums;
17+
18+
/// <summary>
19+
/// Enum for the different types of payout documents.
20+
/// </summary>
21+
public enum PayoutDocumentTypesEnum
22+
{
23+
/// <summary>
24+
/// Default general value.
25+
/// </summary>
26+
Other,
27+
28+
/// <summary>
29+
/// Invoice.
30+
/// </summary>
31+
Invoice,
32+
33+
/// <summary>
34+
/// Purchase order.
35+
/// </summary>
36+
PurchaseOrder,
37+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,13 @@ public Counterparty? DestinationAccount
408408
/// Collection of payrun invoices associated with the payout.
409409
/// Will be empty if the payout is not associated with a payrun.
410410
/// </summary>
411+
[Obsolete("Please refer to the Documents collection.")]
411412
public List<PayrunInvoice>? PayrunInvoices { get; set; }
413+
414+
/// <summary>
415+
/// Documents associated with the payout.
416+
/// </summary>
417+
public List<PayoutDocument>? Documents { get; set; }
412418

413419
public NoFrixionProblem Validate()
414420
{

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ public Guid? BeneficiaryID
195195
/// payment, the default behaviour is to attempt SEPA-INST and fallback to SEPA-CT if rejected.
196196
/// </summary>
197197
public PaymentRailEnum PaymentRail { get; set; }
198+
199+
/// <summary>
200+
/// List of documents to attach to the payout. Optional.
201+
/// Used for identifying or associating documents with the payout.
202+
/// </summary>
203+
public List<PayoutDocumentCreate>? Documents { get; set; }
198204

199205
/// <summary>
200206
/// Places all the payout's properties into a dictionary.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// -----------------------------------------------------------------------------
2+
// Filename: PayoutDocument.cs
3+
//
4+
// Description: Contains details of a payout document.
5+
//
6+
// Author(s):
7+
// Axel Granillo ([email protected])
8+
//
9+
// History:
10+
// 28 11 2024 Axel Granillo Created, Remote, Mexico City, Mexico.
11+
//
12+
// License:
13+
// MIT.
14+
// -----------------------------------------------------------------------------
15+
16+
using NoFrixion.MoneyMoov.Enums;
17+
18+
namespace NoFrixion.MoneyMoov.Models;
19+
20+
/// <summary>
21+
/// Used for returning a payout document.
22+
/// </summary>
23+
public class PayoutDocument : PayoutDocumentCreate
24+
{
25+
/// <summary>
26+
/// Internal ID of the document.
27+
/// </summary>
28+
public Guid ID { get; set; }
29+
30+
/// <summary>
31+
/// Date of insertion.
32+
/// </summary>
33+
public DateTimeOffset Inserted { get; set; }
34+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// -----------------------------------------------------------------------------
2+
// Filename: PayoutDocumentCreate.cs
3+
//
4+
// Description: Contains details of a payout document.
5+
//
6+
// Author(s):
7+
// Axel Granillo ([email protected])
8+
//
9+
// History:
10+
// 28 11 2024 Axel Granillo Created, Remote, Mexico City, Mexico.
11+
//
12+
// License:
13+
// MIT.
14+
// -----------------------------------------------------------------------------
15+
16+
using System.ComponentModel.DataAnnotations;
17+
using NoFrixion.MoneyMoov.Enums;
18+
19+
namespace NoFrixion.MoneyMoov.Models;
20+
21+
/// <summary>
22+
/// Document associated with a payout.
23+
/// </summary>
24+
public class PayoutDocumentCreate
25+
{
26+
/// <summary>
27+
/// Type of the document.
28+
/// </summary>
29+
[Required]
30+
public PayoutDocumentTypesEnum DocumentType { get; set; } = PayoutDocumentTypesEnum.Other;
31+
32+
/// <summary>
33+
/// Used to identify the document.
34+
/// </summary>
35+
[Required]
36+
[MaxLength(128)]
37+
public string? Title { get; set; }
38+
39+
/// <summary>
40+
/// Additional information about the document. Optional.
41+
/// </summary>
42+
[MaxLength(256)]
43+
public string? Description { get; set; }
44+
45+
/// <summary>
46+
/// Currency of the document, if applicable. Optional.
47+
/// </summary>
48+
public CurrencyTypeEnum? Currency { get; set; }
49+
50+
/// <summary>
51+
/// Amount of the document, if applicable. Optional.
52+
/// </summary>
53+
public decimal? Amount { get; set; }
54+
55+
/// <summary>
56+
/// Allows to associate an external ID to the document. Optional.
57+
/// </summary>
58+
[MaxLength(128)]
59+
public string? ExternalID { get; set; }
60+
}

0 commit comments

Comments
 (0)