- 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.
50 lines
1.2 KiB
C#
50 lines
1.2 KiB
C#
namespace FiscalOS.API.Institutions.GetAvailable;
|
|
|
|
internal sealed record Response
|
|
{
|
|
public IEnumerable<AvailableAccountDto> Accounts { get; init; } = [];
|
|
|
|
[JsonConstructor]
|
|
private Response()
|
|
{
|
|
}
|
|
|
|
public static Response From(IEnumerable<AvailableAccountDto> accounts)
|
|
{
|
|
return new Response
|
|
{
|
|
Accounts = accounts
|
|
};
|
|
}
|
|
}
|
|
|
|
internal sealed record AvailableAccountDto
|
|
{
|
|
public string ProviderInstitutionId { get; init; } = string.Empty;
|
|
public string ProviderId { get; init; } = string.Empty;
|
|
public string ProviderName { get; init; } = string.Empty;
|
|
public decimal CurrentBalance { get; init; }
|
|
public decimal AvailableBalance { get; init; }
|
|
public string CurrencyCode { get; init; } = string.Empty;
|
|
|
|
[JsonConstructor]
|
|
private AvailableAccountDto()
|
|
{
|
|
}
|
|
|
|
public static AvailableAccountDto From(
|
|
PlaidInstitutionMetadata plaidMetadata,
|
|
Going.Plaid.Entity.Account plaidAccount
|
|
)
|
|
{
|
|
return new AvailableAccountDto
|
|
{
|
|
ProviderInstitutionId = plaidMetadata.PlaidId,
|
|
ProviderId = plaidAccount.AccountId,
|
|
ProviderName = plaidAccount.Name,
|
|
AvailableBalance = plaidAccount.Available,
|
|
CurrentBalance = plaidAccount.Current,
|
|
CurrencyCode = plaidAccount.CurrencyCode,
|
|
};
|
|
}
|
|
} |