chore(balance): post-merge cleanup of #182-#185 reviews (#187) #195

Merged
maximus merged 7 commits from issue-187-balance-cleanup-post-184-185 into main 2026-05-03 23:42:15 +00:00
2 changed files with 9 additions and 1 deletions
Showing only changes of commit 2eeac78b40 - Show all commits

View file

@ -73,6 +73,13 @@ describe("getStarterCollisions", () => {
expect(result.has("tfsa")).toBe(false);
expect(result.has("cash")).toBe(false); // name "CELI" != "Compte chèque"
});
it("excludes archived accounts via SQL filter", async () => {
mockSelect.mockResolvedValueOnce([]);
await getStarterCollisions();
const sql = mockSelect.mock.calls[0][0];
expect(sql).toMatch(/archived_at IS NULL/);
});
});
describe("proposeStarterAccounts", () => {

View file

@ -487,7 +487,8 @@ export async function getStarterCollisions(): Promise<Set<string>> {
`SELECT c.key AS key, a.name AS account_name
FROM balance_accounts a
INNER JOIN balance_categories c ON c.id = a.balance_category_id
WHERE c.key IN ('cash','tfsa','rrsp','other')`
WHERE c.key IN ('cash','tfsa','rrsp','other')
AND a.archived_at IS NULL`
);
const collisions = new Set<string>();
for (const starter of STARTER_ACCOUNTS) {