diff --git a/src/NoFrixion.MoneyMoov/Enums/PayoutDocumentTypesEnum.cs b/src/NoFrixion.MoneyMoov/Enums/PayoutDocumentTypesEnum.cs new file mode 100644 index 0000000..6593e20 --- /dev/null +++ b/src/NoFrixion.MoneyMoov/Enums/PayoutDocumentTypesEnum.cs @@ -0,0 +1,37 @@ +// ----------------------------------------------------------------------------- +// Filename: PayoutDocumentTypesEnum.cs +// +// Description: Enum for the different types of payout documents. +// +// Author(s): +// Axel Granillo (axel@nofrixion.com) +// +// History: +// 28 11 2024 Axel Granillo Created, Remote, Mexico City, Mexico. +// +// License: +// MIT. +// ----------------------------------------------------------------------------- + +namespace NoFrixion.MoneyMoov.Enums; + +/// +/// Enum for the different types of payout documents. +/// +public enum PayoutDocumentTypesEnum +{ + /// + /// Default general value. + /// + Other, + + /// + /// Invoice. + /// + Invoice, + + /// + /// Purchase order. + /// + PurchaseOrder, +} \ No newline at end of file diff --git a/src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs b/src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs index e7e064b..13efee2 100755 --- a/src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs +++ b/src/NoFrixion.MoneyMoov/Models/Payouts/Payout.cs @@ -408,7 +408,13 @@ public Counterparty? DestinationAccount /// Collection of payrun invoices associated with the payout. /// Will be empty if the payout is not associated with a payrun. /// + [Obsolete("Please refer to the Documents collection.")] public List? PayrunInvoices { get; set; } + + /// + /// Documents associated with the payout. + /// + public List? Documents { get; set; } public NoFrixionProblem Validate() { diff --git a/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs b/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs index a15d21d..0317683 100755 --- a/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs +++ b/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutCreate.cs @@ -195,6 +195,12 @@ public Guid? BeneficiaryID /// payment, the default behaviour is to attempt SEPA-INST and fallback to SEPA-CT if rejected. /// public PaymentRailEnum PaymentRail { get; set; } + + /// + /// List of documents to attach to the payout. Optional. + /// Used for identifying or associating documents with the payout. + /// + public List? Documents { get; set; } /// /// Places all the payout's properties into a dictionary. diff --git a/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutDocument.cs b/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutDocument.cs new file mode 100644 index 0000000..ee61149 --- /dev/null +++ b/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutDocument.cs @@ -0,0 +1,34 @@ +// ----------------------------------------------------------------------------- +// Filename: PayoutDocument.cs +// +// Description: Contains details of a payout document. +// +// Author(s): +// Axel Granillo (axel@nofrixion.com) +// +// History: +// 28 11 2024 Axel Granillo Created, Remote, Mexico City, Mexico. +// +// License: +// MIT. +// ----------------------------------------------------------------------------- + +using NoFrixion.MoneyMoov.Enums; + +namespace NoFrixion.MoneyMoov.Models; + +/// +/// Used for returning a payout document. +/// +public class PayoutDocument : PayoutDocumentCreate +{ + /// + /// Internal ID of the document. + /// + public Guid ID { get; set; } + + /// + /// Date of insertion. + /// + public DateTimeOffset Inserted { get; set; } +} \ No newline at end of file diff --git a/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutDocumentCreate.cs b/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutDocumentCreate.cs new file mode 100644 index 0000000..42b6402 --- /dev/null +++ b/src/NoFrixion.MoneyMoov/Models/Payouts/PayoutDocumentCreate.cs @@ -0,0 +1,60 @@ +// ----------------------------------------------------------------------------- +// Filename: PayoutDocumentCreate.cs +// +// Description: Contains details of a payout document. +// +// Author(s): +// Axel Granillo (axel@nofrixion.com) +// +// History: +// 28 11 2024 Axel Granillo Created, Remote, Mexico City, Mexico. +// +// License: +// MIT. +// ----------------------------------------------------------------------------- + +using System.ComponentModel.DataAnnotations; +using NoFrixion.MoneyMoov.Enums; + +namespace NoFrixion.MoneyMoov.Models; + +/// +/// Document associated with a payout. +/// +public class PayoutDocumentCreate +{ + /// + /// Type of the document. + /// + [Required] + public PayoutDocumentTypesEnum DocumentType { get; set; } = PayoutDocumentTypesEnum.Other; + + /// + /// Used to identify the document. + /// + [Required] + [MaxLength(128)] + public string? Title { get; set; } + + /// + /// Additional information about the document. Optional. + /// + [MaxLength(256)] + public string? Description { get; set; } + + /// + /// Currency of the document, if applicable. Optional. + /// + public CurrencyTypeEnum? Currency { get; set; } + + /// + /// Amount of the document, if applicable. Optional. + /// + public decimal? Amount { get; set; } + + /// + /// Allows to associate an external ID to the document. Optional. + /// + [MaxLength(128)] + public string? ExternalID { get; set; } +} \ No newline at end of file