2026-02-12 16:19:51 -06:00
|
|
|
namespace FiscalOS.Infra.Accounts.Plaid;
|
|
|
|
|
|
2026-03-01 19:56:29 -06:00
|
|
|
public sealed class PlaidInstitutionMetadata : InstitutionMetadata
|
2026-02-12 16:19:51 -06:00
|
|
|
{
|
2026-02-13 11:05:30 -06:00
|
|
|
public const string TypeValue = Providers.Plaid;
|
2026-02-12 16:19:51 -06:00
|
|
|
public string PlaidId { get; init; } = string.Empty;
|
|
|
|
|
public string PlaidName { get; init; } = string.Empty;
|
|
|
|
|
public string EncryptedAccessToken { get; init; } = string.Empty;
|
2026-03-01 19:56:29 -06:00
|
|
|
public string ItemId { get; init; } = string.Empty;
|
2026-02-12 16:19:51 -06:00
|
|
|
|
2026-03-01 19:56:29 -06:00
|
|
|
private PlaidInstitutionMetadata() : base(TypeValue)
|
2026-02-12 16:19:51 -06:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-01 19:56:29 -06:00
|
|
|
public static PlaidInstitutionMetadata From(
|
2026-02-12 20:48:49 -06:00
|
|
|
string? plaidId,
|
|
|
|
|
string? plaidName,
|
2026-03-01 19:56:29 -06:00
|
|
|
string encryptedAccessToken,
|
|
|
|
|
string itemId
|
2026-02-12 16:19:51 -06:00
|
|
|
)
|
|
|
|
|
{
|
2026-02-12 20:48:49 -06:00
|
|
|
ArgumentNullException.ThrowIfNull(plaidId, nameof(plaidId));
|
|
|
|
|
ArgumentNullException.ThrowIfNull(plaidName, nameof(plaidName));
|
|
|
|
|
ArgumentNullException.ThrowIfNull(encryptedAccessToken, nameof(encryptedAccessToken));
|
2026-03-01 19:56:29 -06:00
|
|
|
ArgumentNullException.ThrowIfNull(itemId, nameof(itemId));
|
2026-02-12 20:48:49 -06:00
|
|
|
|
2026-03-01 19:56:29 -06:00
|
|
|
return new()
|
2026-02-12 16:19:51 -06:00
|
|
|
{
|
|
|
|
|
PlaidId = plaidId,
|
|
|
|
|
PlaidName = plaidName,
|
2026-03-01 19:56:29 -06:00
|
|
|
EncryptedAccessToken = encryptedAccessToken,
|
|
|
|
|
ItemId = itemId,
|
2026-02-12 16:19:51 -06:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|