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) <noreply@anthropic.com>

* fix: remove stale companySettings reference from log

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-04-03 13:31:29 +02:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 8855aa99f7
commit f69f1daac3
+3 -9
View File
@@ -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,
})