From f69f1daac35bf7716f4e6bbc9e41da86fef6e1f0 Mon Sep 17 00:00:00 2001 From: Jakob Wennberg <149234542+jakobwennberg@users.noreply.github.com> Date: Fri, 3 Apr 2026 13:31:29 +0200 Subject: [PATCH] fix: always use business PSU type for bank connections (#169) * fix: always use business PSU type for bank connections EF (sole trader) users connecting to Nordea got personal accounts because psu_type was set to 'personal' based on entity_type. Since gnubok is accounting software, all bank connections should use 'business' PSU type regardless of entity type. Co-Authored-By: Claude Opus 4.6 (1M context) * fix: remove stale companySettings reference from log Co-Authored-By: Claude Opus 4.6 (1M context) --------- Co-authored-by: Claude Opus 4.6 (1M context) --- extensions/general/enable-banking/index.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/extensions/general/enable-banking/index.ts b/extensions/general/enable-banking/index.ts index a74604f5..30c1ed27 100644 --- a/extensions/general/enable-banking/index.ts +++ b/extensions/general/enable-banking/index.ts @@ -84,20 +84,14 @@ export const enableBankingExtension: Extension = { } try { - // Determine PSU type from entity type - const { data: companySettings } = await supabase - .from('company_settings') - .select('entity_type') - .eq('company_id', ctx?.companyId ?? user.id) - .single() - - const psuType = companySettings?.entity_type === 'aktiebolag' ? 'business' : 'personal' + // Always use 'business' PSU type — gnubok is accounting software, + // users connect business accounts regardless of entity type (AB or EF) + const psuType = 'business' log.info('[enable-banking] Starting bank connection', { user_id: user.id, bank: aspsp_name, country: aspsp_country, - entity_type: companySettings?.entity_type, psu_type: psuType, })