fix(docs): Add missing documentation for transactions

This commit is contained in:
Valters Melnalksnis
2022-06-18 10:48:13 +03:00
parent c0131b73db
commit d81498bfa8
5 changed files with 51 additions and 9 deletions
@@ -4,26 +4,52 @@
using NodaTime;
using VMelnalksnis.NordigenDotNet.Institutions;
#pragma warning disable SA1623
namespace VMelnalksnis.NordigenDotNet.Accounts;
/// <summary>A transaction that has been booked - posted to an account on the account servicer's books.</summary>
/// <param name="TransactionAmount">The amount transferred in this transaction.</param>
/// <param name="UnstructuredInformation">Unstructured information about the transaction, usually added by the debtor.</param>
/// <param name="TransactionId">A unique transaction id created by the <see cref="Institution"/>.</param>
/// <param name="BookingDate">The date when an entry is posted to an account on the account servicer's books.</param>
public record BookedTransaction(
AmountInCurrency Amount,
string RemittanceInformationUnstructured,
AmountInCurrency TransactionAmount,
string UnstructuredInformation,
string TransactionId,
LocalDate BookingDate)
: Transaction(Amount, RemittanceInformationUnstructured)
: Transaction(TransactionAmount, UnstructuredInformation)
{
/// <summary>The name of the counterparty that sends <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public string? DebtorName { get; init; }
/// <summary>The account of the counterparty that sends <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public TransactionAccount? DebtorAccount { get; init; }
/// <summary>The name of the counterparty that receives <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public string? CreditorName { get; init; }
/// <summary>The account of the counterparty that receives <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public TransactionAccount? CreditorAccount { get; init; }
/// <summary>The ISO 20022 bank transaction code.</summary>
/// <example>Some example values:
/// <code>
/// PMNT-ICDT-STDO
/// PMNT-IRCT-STDO
/// </code></example>
public string? BankTransactionCode { get; init; }
/// <summary>A transaction id, used both by the transaction and any fees paid to the <see cref="Institution"/> for the transaction.</summary>
public string? EntryReference { get; init; }
/// <summary>Additional structured information about the transaction from the institution.</summary>
/// <example>
/// <code>
/// PURCHASE
/// INWARD TRANSFER
/// </code></example>
public string? AdditionalInformation { get; init; }
}
@@ -4,7 +4,8 @@
namespace VMelnalksnis.NordigenDotNet.Accounts;
public record PendingTransaction(
AmountInCurrency Amount,
string RemittanceInformationUnstructured)
: Transaction(Amount, RemittanceInformationUnstructured);
/// <summary>A transaction that is still pending.</summary>
/// <param name="TransactionAmount">The amount transferred in this transaction.</param>
/// <param name="UnstructuredInformation">Unstructured information about the transaction, usually added by the debtor.</param>
public record PendingTransaction(AmountInCurrency TransactionAmount, string UnstructuredInformation)
: Transaction(TransactionAmount, UnstructuredInformation);
@@ -2,11 +2,21 @@
// Licensed under the Apache License 2.0.
// See LICENSE file in the project root for full license information.
using System.Text.Json.Serialization;
using NodaTime;
#pragma warning disable SA1623
namespace VMelnalksnis.NordigenDotNet.Accounts;
public record Transaction(AmountInCurrency TransactionAmount, string RemittanceInformationUnstructured)
/// <summary>Common information for all transactions.</summary>
/// <param name="TransactionAmount">The amount transferred in this transaction.</param>
/// <param name="UnstructuredInformation">Unstructured information about the transaction, usually added by the debtor.</param>
public abstract record Transaction(
AmountInCurrency TransactionAmount,
[property: JsonPropertyName("remittanceInformationUnstructured")] string UnstructuredInformation)
{
private LocalDate? ValueDate { get; init; }
/// <summary>The date when the transaction was valued at.</summary>
public LocalDate? ValueDate { get; init; }
}
@@ -4,4 +4,6 @@
namespace VMelnalksnis.NordigenDotNet.Accounts;
/// <summary>An account that can be referenced from a <see cref="Transaction"/>.</summary>
/// <param name="Iban">The IBAN of the account.</param>
public record TransactionAccount(string Iban);
@@ -6,6 +6,9 @@ using System.Collections.Generic;
namespace VMelnalksnis.NordigenDotNet.Accounts;
/// <summary>All transactions of an account.</summary>
/// <param name="Booked">All transactions that have been booked.</param>
/// <param name="Pending">All transaction that are still pending.</param>
public record Transactions(List<BookedTransaction> Booked, List<PendingTransaction> Pending);
internal record TransactionsWrapper(Transactions Transactions);