feat: update account handling in add endpoint and tests

This commit is contained in:
Stevan Freeborn
2026-03-09 04:29:01 -05:00
parent 3866030eae
commit 62a7dde443
4 changed files with 12 additions and 4 deletions
@@ -169,8 +169,6 @@ public class AddTests(TestApi testApi) : IntegrationTest(testApi)
var userEncryptionKey = await encryptor.GenerateEncryptedKeyAsync(ct);
var user = User.From("User1", passwordHasher.Hash("@Password1"), userEncryptionKey);
await context.AddAsync(user, ct);
var encryptedAccessToken = await encryptor.EncryptAsyncFor(user, "accessToken", ct);
var plaidMetadata = PlaidInstitutionMetadata.From(
"alreadyExists",
@@ -183,11 +181,13 @@ public class AddTests(TestApi testApi) : IntegrationTest(testApi)
await context.AddAsync(institution, ct);
var plaidAccountMetadata = PlaidAccountMetadata.From("accountId", "Some Account");
var account = Account.From(institution.Id, "Some Account", plaidAccountMetadata);
var account = Account.From("Some Account", plaidAccountMetadata);
institution.AddAccount(account);
user.AddInstitution(institution);
user.AddAccount(account);
await context.AddAsync(user, ct);
await context.SaveChangesAsync(ct);
return (user, institution, account);
}, TestContext.Current.CancellationToken);