Skip to content

Commit f6f6d7f

Browse files
committed
Fix types
1 parent bede211 commit f6f6d7f

File tree

14 files changed

+20
-16
lines changed

14 files changed

+20
-16
lines changed

apps/engine/src/providers/gocardless/__snapshots__/transform.test.ts.snap

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ exports[`Transform accounts 1`] = `
2626
"id": "PLEO_PLEODK00",
2727
"logo": "https://cdn-logos.gocardless.com/ais/PLEO_PLEODK00.png",
2828
"name": "Pleo",
29+
"provider": "gocardless",
2930
},
3031
"name": "Pleo Account",
3132
"provider": "gocardless",

apps/engine/src/providers/gocardless/transform.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test("Transform accounts", () => {
4343
iban: "123",
4444
ownerName: "Name",
4545
},
46-
bank: {
46+
institution: {
4747
id: "PLEO_PLEODK00",
4848
name: "Pleo",
4949
bic: "PLEODK00",

apps/engine/src/providers/gocardless/transform.ts

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export const transformAccount = ({
188188
id: institution?.id,
189189
logo: institution?.logo,
190190
name: institution?.name,
191+
provider: Providers.Enum.gocardless,
191192
}
192193
: null,
193194
provider: Providers.Enum.gocardless,

apps/engine/src/providers/plaid/__snapshots__/transform.test.ts.snap

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ exports[`Transform accounts 1`] = `
6060
"id": "ins_100546",
6161
"logo": null,
6262
"name": "American Funds Retirement Solutions",
63+
"provider": "plaid",
6364
},
6465
"name": "Plaid Mortgage",
6566
"provider": "plaid",

apps/engine/src/providers/plaid/transform.ts

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export const transformAccount = ({
189189
id: institution.id,
190190
name: institution.name,
191191
logo: institution.logo ?? null,
192+
provider: Providers.Enum.plaid,
192193
}
193194
: null,
194195
provider: Providers.Enum.plaid,

apps/engine/src/providers/teller/__snapshots__/transform.test.ts.snap

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ exports[`Transform accounts 1`] = `
9494
"id": "mercury",
9595
"logo": "https://teller.io/images/banks/mercury.jpg",
9696
"name": "Mercury",
97+
"provider": "teller",
9798
},
9899
"name": "Platinum Card",
99100
"provider": "teller",

apps/engine/src/providers/teller/transform.ts

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export const transformAccount = ({
154154
? {
155155
...institution,
156156
logo: `https://teller.io/images/banks/${institution.id}.jpg`,
157+
provider: Providers.Enum.teller,
157158
}
158159
: null,
159160
enrollment_id: enrollment_id,

apps/engine/src/providers/teller/types.ts

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export type AuthenticatedRequest = {
8181
type Institution = {
8282
id: string;
8383
name: string;
84-
capabilities: string[];
8584
};
8685

8786
interface BaseAccount {

apps/engine/src/providers/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export type Institution = {
3535
id: string;
3636
name: string;
3737
logo: string | null;
38+
provider: Providers;
3839
};
3940

4041
export type Account = {

apps/engine/src/routes/accounts/schema.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const AccountsParamsSchema = z.object({
1515
example: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1616
}),
1717
provider: Providers.openapi({
18-
example: "teller",
18+
example: Providers.Enum.teller,
1919
}),
2020
countryCode: z
2121
.string()
@@ -69,7 +69,7 @@ export const AccountSchema = z
6969
example: "USD",
7070
}),
7171
provider: Providers.openapi({
72-
example: "teller",
72+
example: Providers.Enum.teller,
7373
}),
7474
institution: InstitutionSchema.nullable(),
7575
enrollment_id: z
@@ -98,7 +98,7 @@ export const AccountBalanceParamsSchema = z
9898
example: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
9999
}),
100100
provider: Providers.openapi({
101-
example: "teller",
101+
example: Providers.Enum.teller,
102102
}),
103103
accessToken: z
104104
.string()
@@ -140,7 +140,7 @@ export const DeleteAccountsParamsSchema = z
140140
example: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
141141
}),
142142
provider: Providers.openapi({
143-
example: "teller",
143+
example: Providers.Enum.teller,
144144
}),
145145
accessToken: z
146146
.string()

apps/engine/src/routes/institutions/schema.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export const InstitutionSchema = z
1010
name: z.string().openapi({
1111
example: "Wells Fargo Bank",
1212
}),
13-
1413
logo: z
1514
.string()
1615
.openapi({
@@ -19,7 +18,7 @@ export const InstitutionSchema = z
1918
})
2019
.nullable(),
2120
provider: Providers.openapi({
22-
example: "teller",
21+
example: Providers.Enum.teller,
2322
}),
2423
})
2524
.openapi("InstitutionSchema");

apps/engine/src/routes/transactions/schema.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const TransactionsParamsSchema = z
88
name: "provider",
99
in: "query",
1010
},
11-
example: "teller",
11+
example: Providers.Enum.teller,
1212
}),
1313
accountId: z.string().openapi({
1414
description: "Get transactions by accountId",

apps/engine/src/scheduled/index.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { getInstitutions } from "@/routes/institutions/utils";
1+
// import { getInstitutions } from "@/routes/institutions/utils";
22
import type { Env } from "hono";
33

44
export async function syncInstitutions(env: Env) {
5-
const result = await getInstitutions();
6-
7-
console.log(result);
5+
// const result = await getInstitutions();
6+
// console.log(result);
87
}

packages/providers/src/gocardless/transform.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test("Transform income transaction", () => {
2424
proprietaryBankTransactionCode: "Transfer",
2525
internalTransactionId: "86b1bc36e6a6d2a5dee8ff7138920255",
2626
},
27-
})
27+
}),
2828
).toMatchSnapshot();
2929
});
3030

@@ -54,7 +54,7 @@ test("Transform accounts", () => {
5454
countries: ["DK", "GB", "DE", "SE", "ES", "IE", "DK"],
5555
logo: "https://cdn-logos.gocardless.com/ais/PLEO_PLEODK00.png",
5656
},
57-
})
57+
}),
5858
).toMatchSnapshot();
5959
});
6060

@@ -63,6 +63,6 @@ test("Transform account balance", () => {
6363
transformAccountBalance({
6464
currency: "SEK",
6565
amount: "1942682.86",
66-
})
66+
}),
6767
).toMatchSnapshot();
6868
});

0 commit comments

Comments
 (0)