feat(cloud): add billing wip

This commit is contained in:
Mauricio Siu
2024-10-20 00:14:27 -06:00
parent 319584d911
commit fe0a662afd
11 changed files with 4933 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
import { relations } from "drizzle-orm";
import { boolean, pgTable, text } from "drizzle-orm/pg-core";
import { boolean, integer, pgTable, text } from "drizzle-orm/pg-core";
import { createInsertSchema } from "drizzle-zod";
import { nanoid } from "nanoid";
import { z } from "zod";
@@ -28,6 +28,9 @@ export const admins = pgTable("admin", {
createdAt: text("createdAt")
.notNull()
.$defaultFn(() => new Date().toISOString()),
stripeCustomerId: text("stripeCustomerId"),
stripeSubscriptionId: text("stripeSubscriptionId"),
totalServers: integer("totalServers").notNull().default(0),
});
export const adminsRelations = relations(admins, ({ one, many }) => ({