refactor(api): introduce DTOs for institutional account discovery
- Replace raw Plaid entity response with a dedicated Response wrapper - Map Plaid accounts to AccountDto to decouple API from external SDK models - Update integration tests to assert against the new response structure - Add JsonConstructors to DTO records for reliable deserialization
This commit is contained in:
@@ -44,7 +44,8 @@ internal static class Endpoint
|
||||
|
||||
var accessToken = await encryptor.DecryptAsyncFor(user, plaidMetadata.EncryptedAccessToken, ct);
|
||||
var accounts = await plaidService.GetAccountsAsync(accessToken);
|
||||
var accountsDtos = accounts.Select(AccountDto.FromPlaidAccount);
|
||||
|
||||
return Results.Ok(accounts);
|
||||
return Results.Ok(Response.From(accountsDtos));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user