1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-08 23:15:24 +02:00
This commit is contained in:
Tyler Myracle 2024-01-21 03:27:14 -06:00
parent 76ed354d76
commit 92c46f35eb

View file

@ -141,7 +141,6 @@ export class TellerETL implements IETL<Connection, TellerRawData, TellerData> {
// upsert accounts // upsert accounts
...accounts.map((tellerAccount) => { ...accounts.map((tellerAccount) => {
const type = TellerUtil.getType(tellerAccount.type) const type = TellerUtil.getType(tellerAccount.type)
const categoryProvider = TellerUtil.tellerTypesToCategory(tellerAccount.type)
const classification = AccountUtil.getClassification(type) const classification = AccountUtil.getClassification(type)
return this.prisma.account.upsert({ return this.prisma.account.upsert({
@ -152,9 +151,9 @@ export class TellerETL implements IETL<Connection, TellerRawData, TellerData> {
}, },
}, },
create: { create: {
type, type: TellerUtil.getType(tellerAccount.type),
provider: 'teller', provider: 'teller',
categoryProvider, categoryProvider: TellerUtil.tellerTypesToCategory(tellerAccount.type),
subcategoryProvider: tellerAccount.subtype ?? 'other', subcategoryProvider: tellerAccount.subtype ?? 'other',
accountConnectionId: connection.id, accountConnectionId: connection.id,
userId: connection.userId, userId: connection.userId,
@ -264,11 +263,7 @@ export class TellerETL implements IETL<Connection, TellerRawData, TellerData> {
${details.counterparty?.name ?? ''}, ${details.counterparty?.name ?? ''},
${type}, ${type},
${details.category ?? ''}, ${details.category ?? ''},
${ ${maybeCategoryByTellerCategory[details.category ?? ''] ?? 'Other'}
details.category
? maybeCategoryByTellerCategory[details.category]
: 'Other'
}
)` )`
}) })
)} )}