feat: add Plaid transaction handling and async queue processing
- introduced new migration to add Cursor column to AccountMetadata. - updated AppDbContext model snapshot to reflect changes in the database schema. - implemented async queue processing with ChannelAsyncQueue and AsyncQueueHostedService. - created Plaid transaction handlers for added, modified, and removed transactions. - developed PlaidTransactionService and PlaidTransactionSyncer for syncing transactions. - added SyncUpdatesProcessor to handle sync updates from Plaid. - updated tests to accommodate changes in institution and account metadata handling.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
|
||||
using FiscalOS.Infra.Common;
|
||||
|
||||
namespace FiscalOS.Infra.Accounts.Plaid;
|
||||
|
||||
public sealed class PlaidAccountMetadata : AccountMetadata
|
||||
@@ -5,12 +8,16 @@ public sealed class PlaidAccountMetadata : AccountMetadata
|
||||
public const string TypeValue = Providers.Plaid;
|
||||
public string PlaidId { get; init; } = string.Empty;
|
||||
public string PlaidName { get; init; } = string.Empty;
|
||||
public string? Cursor { get; private set; }
|
||||
|
||||
private PlaidAccountMetadata() : base(TypeValue)
|
||||
{
|
||||
}
|
||||
|
||||
public static PlaidAccountMetadata From(string plaidId, string plaidName)
|
||||
public static PlaidAccountMetadata From(
|
||||
string plaidId,
|
||||
string plaidName
|
||||
)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
@@ -18,4 +25,11 @@ public sealed class PlaidAccountMetadata : AccountMetadata
|
||||
PlaidName = plaidName,
|
||||
};
|
||||
}
|
||||
|
||||
public void SetCursor(string cursor)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(cursor, nameof(cursor));
|
||||
|
||||
Cursor = cursor;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user