feat: update multiple balances

This commit is contained in:
Max Koon
2025-10-15 12:04:45 -04:00
parent 415150d58e
commit 1551d39978
6 changed files with 147 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
import { definePermissions } from "@rocicorp/zero";
import { pgTable, text, boolean, timestamp, uniqueIndex, decimal } from "drizzle-orm/pg-core";
export const users = pgTable(
@@ -29,3 +30,13 @@ export const plaidLink = pgTable("plaidLink", {
createdAt: timestamp("created_at").notNull().defaultNow(),
});
export const balance = pgTable("balance", {
id: text("id").primaryKey(),
user_id: text("userId").notNull(),
plaid_id: text("plaidId").notNull().unique(),
avaliable: decimal("avaliable").notNull(),
current: decimal("current").notNull(),
name: text("name").notNull(),
createdAt: timestamp("created_at").notNull().defaultNow(),
updatedAt: timestamp("updated_at").notNull().defaultNow(),
})