This commit is contained in:
2022-12-16 19:47:16 +01:00
parent 8f74c553e5
commit 3b542c1230
5 changed files with 52 additions and 70 deletions
@@ -1,55 +0,0 @@
// Copyright 2022 Valters Melnalksnis
// Licensed under the Apache License 2.0.
// See LICENSE file in the project root for full license information.
using System;
using NodaTime;
using VMelnalksnis.NordigenDotNet.Institutions;
namespace VMelnalksnis.NordigenDotNet.Accounts;
/// <summary>A transaction that has been booked - posted to an account on the account servicer's books.</summary>
public record BookedTransaction : Transaction
{
/// <summary>Gets or sets a unique transaction id created by the <see cref="Institution"/>.</summary>
public string TransactionId { get; set; } = null!;
/// <summary>Gets or sets a unique transaction id created by Nordigen.</summary>
public string InternalTransactionId { get; set; } = null!;
/// <summary>Gets or sets the date when an entry is posted to an account on the account servicer's books.</summary>
public DateTimeOffset BookingDate { get; set; }
/// <summary>Gets or sets the name of the counterparty that sends <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public string? DebtorName { get; set; }
/// <summary>Gets or sets the account of the counterparty that sends <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public TransactionAccount? DebtorAccount { get; set; }
/// <summary>Gets or sets the name of the counterparty that receives <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public string? CreditorName { get; set; }
/// <summary>Gets or sets the account of the counterparty that receives <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public TransactionAccount? CreditorAccount { get; set; }
/// <summary>Gets or sets the ISO 20022 bank transaction code.</summary>
/// <example>Some example values:
/// <code>
/// PMNT-ICDT-STDO
/// PMNT-IRCT-STDO
/// </code></example>
public string? BankTransactionCode { get; set; }
/// <summary>Gets or sets 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; set; }
/// <summary>Gets or sets additional structured information about the transaction from the institution.</summary>
/// <example>
/// <code>
/// PURCHASE
/// INWARD TRANSFER
/// </code></example>
public string? AdditionalInformation { get; set; }
}
@@ -1,8 +0,0 @@
// Copyright 2022 Valters Melnalksnis
// Licensed under the Apache License 2.0.
// See LICENSE file in the project root for full license information.
namespace VMelnalksnis.NordigenDotNet.Accounts;
/// <summary>A transaction that is still pending.</summary>
public record PendingTransaction : Transaction;
@@ -10,7 +10,7 @@ using NodaTime;
namespace VMelnalksnis.NordigenDotNet.Accounts;
/// <summary>Common information for all transactions.</summary>
public abstract record Transaction
public record Transaction
{
/// <summary>Gets or sets the amount transferred in this transaction.</summary>
public AmountInCurrency TransactionAmount { get; set; } = null!;
@@ -21,4 +21,49 @@ public abstract record Transaction
/// <summary>Gets or sets the date when the transaction was valued at.</summary>
public DateTimeOffset? ValueDate { get; set; }
/// <summary>Gets or sets a unique transaction id created by the <see cref="Institution"/>.</summary>
public string TransactionId { get; set; } = null!;
/// <summary>Gets or sets a unique transaction id created by Nordigen.</summary>
public string InternalTransactionId { get; set; } = null!;
/// <summary>Gets or sets the date when an entry is posted to an account on the account servicer's books.</summary>
public DateTimeOffset? BookingDate { get; set; }
/// <summary>Gets or sets the name of the counterparty that sends <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public string? DebtorName { get; set; }
/// <summary>Gets or sets the account of the counterparty that sends <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public TransactionAccount? DebtorAccount { get; set; }
/// <summary>Gets or sets the name of the counterparty that receives <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public string? CreditorName { get; set; }
/// <summary>Gets or sets the account of the counterparty that receives <see cref="Transaction.TransactionAmount"/> during the transaction.</summary>
public TransactionAccount? CreditorAccount { get; set; }
/// <summary>Gets or sets the ISO 20022 bank transaction code.</summary>
/// <example>Some example values:
/// <code>
/// PMNT-ICDT-STDO
/// PMNT-IRCT-STDO
/// </code></example>
public string? BankTransactionCode { get; set; }
/// <summary>Gets or sets 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; set; }
/// <summary>Gets or sets additional structured information about the transaction from the institution.</summary>
/// <example>
/// <code>
/// PURCHASE
/// INWARD TRANSFER
/// </code></example>
public string? AdditionalInformation { get; set; }
}
public record PendingTransaction : Transaction
{
}
@@ -10,7 +10,7 @@ namespace VMelnalksnis.NordigenDotNet.Accounts;
public record Transactions
{
/// <summary>Gets or sets all transactions that have been booked.</summary>
public List<BookedTransaction> Booked { get; set; } = null!;
public List<Transaction> Booked { get; set; } = null!;
/// <summary>Gets or sets all transaction that are still pending.</summary>
public List<PendingTransaction> Pending { get; set; } = null!;
@@ -14,17 +14,17 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces"/>
<PackageReference Include="System.ComponentModel.Annotations"/>
<PackageReference Include="System.Net.Http.Json"/>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<PackageReference Include="System.ComponentModel.Annotations" />
<PackageReference Include="System.Net.Http.Json" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\"/>
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="VMelnalksnis.NordigenDotNet.Tests, PublicKey=0024000004800000140100000602000000240000525341310008000001000100EB0D22468771DA92473388BE6F0A462847841312FCCF88BEDADB46CC99B17ACD0EE10EDF8F81BD42FCA7B1073AE2519C553AD61ABDC34F1170EECEDE601360761F1CF76AA062B59A31DF0BF52DA927AAA40588D706D6E04590B75F29209638E593E5D0D29BCE26BF41862FF8B90EE10F2DC6F601CB2363898D0F0A0A6A99E6B8C3020233DDB8B083B813E52E7FA4A67D66E535F87E4D4F9ACBE6D8524E919698B0BDC8B221977EBD1CE6529CFC77A2B5889A7D2EED6A4246A1523791B0CB5AB7B54BA33E206B3B6579DE530F66C99922DF456378275ADF0E3FBDC59D9CC9B051723BB3687E268EF25F752C88A28AD534F03CACA64D3B847203439FEDEA9A99AC"/>
<InternalsVisibleTo Include="VMelnalksnis.NordigenDotNet.Tests, PublicKey=0024000004800000140100000602000000240000525341310008000001000100EB0D22468771DA92473388BE6F0A462847841312FCCF88BEDADB46CC99B17ACD0EE10EDF8F81BD42FCA7B1073AE2519C553AD61ABDC34F1170EECEDE601360761F1CF76AA062B59A31DF0BF52DA927AAA40588D706D6E04590B75F29209638E593E5D0D29BCE26BF41862FF8B90EE10F2DC6F601CB2363898D0F0A0A6A99E6B8C3020233DDB8B083B813E52E7FA4A67D66E535F87E4D4F9ACBE6D8524E919698B0BDC8B221977EBD1CE6529CFC77A2B5889A7D2EED6A4246A1523791B0CB5AB7B54BA33E206B3B6579DE530F66C99922DF456378275ADF0E3FBDC59D9CC9B051723BB3687E268EF25F752C88A28AD534F03CACA64D3B847203439FEDEA9A99AC" />
</ItemGroup>
</Project>