feat: query plaid transactions

This commit is contained in:
Max Koon
2025-10-15 10:53:37 -04:00
parent 23987e4f87
commit 415150d58e
12 changed files with 322 additions and 32 deletions

View File

@@ -92,3 +92,10 @@ export const auditLogs = pgTable("audit_log", {
.references(() => users.id, { onDelete: "cascade" }),
action: text("action").notNull(),
});
export const plaidAccessTokens = pgTable("plaidAccessToken", {
id: text("id").primaryKey(),
userId: text("user_id").notNull(),
token: text("token").notNull(),
createdAt: timestamp("created_at").notNull().defaultNow(),
});

View File

@@ -1,4 +1,4 @@
import { integer, pgTable, text, boolean, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
import { pgTable, text, boolean, timestamp, uniqueIndex, decimal } from "drizzle-orm/pg-core";
export const users = pgTable(
"user",
@@ -18,7 +18,14 @@ export const transaction = pgTable("transaction", {
id: text("id").primaryKey(),
user_id: text("user_id").notNull(),
name: text("name").notNull(),
amount: integer("amount").notNull(),
amount: decimal("amount").notNull(),
});
export const plaidLink = pgTable("plaidLink", {
id: text("id").primaryKey(),
user_id: text("user_id").notNull(),
link: text("link").notNull(),
token: text("token").notNull(),
createdAt: timestamp("created_at").notNull().defaultNow(),
});