feat: add guarded savings agent tools
This commit is contained in:
34
convex/bank/balanceProviders.test.ts
Normal file
34
convex/bank/balanceProviders.test.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { mapComdirectBalances } from "./comdirectProvider";
|
||||
|
||||
describe("mapComdirectBalances", () => {
|
||||
test("normalizes comdirect balance payloads into provider balances", () => {
|
||||
const result = mapComdirectBalances({
|
||||
values: [
|
||||
{
|
||||
account: {
|
||||
accountId: "account-1",
|
||||
iban: "DE89370400440532013000",
|
||||
accountType: { text: "Girokonto" },
|
||||
},
|
||||
balance: { value: "1234.56", unit: "EUR" },
|
||||
date: "2026-06-23",
|
||||
},
|
||||
{
|
||||
account: {},
|
||||
balance: { value: "999" },
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(result).toEqual([
|
||||
{
|
||||
externalId: "account-1",
|
||||
balance: 1234.56,
|
||||
currency: "EUR",
|
||||
asOf: "2026-06-23",
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user