import { boolean, integer, jsonb, pgTable, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
export const organizations = pgTable("organizations", {
    id: uuid("id").primaryKey().defaultRandom(),
    urlKey: text("url_key").notNull(),
    name: text("name").notNull(),
    description: text("description"),
    status: text("status").notNull().default("active"),
    pauseReason: text("pause_reason"),
    pausedAt: timestamp("paused_at", { withTimezone: true }),
    issuePrefix: text("issue_prefix").notNull().default("PAP"),
    issueCounter: integer("issue_counter").notNull().default(0),
    budgetMonthlyCents: integer("budget_monthly_cents").notNull().default(0),
    spentMonthlyCents: integer("spent_monthly_cents").notNull().default(0),
    requireBoardApprovalForNewAgents: boolean("require_board_approval_for_new_agents")
        .notNull()
        .default(true),
    defaultChatIssueCreationMode: text("default_chat_issue_creation_mode").notNull().default("manual_approval"),
    workspaceConfig: jsonb("workspace_config").$type(),
    brandColor: text("brand_color"),
    createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
    updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
}, (table) => ({
    issuePrefixUniqueIdx: uniqueIndex("organizations_issue_prefix_idx").on(table.issuePrefix),
    urlKeyUniqueIdx: uniqueIndex("organizations_url_key_idx").on(table.urlKey),
}));
//# sourceMappingURL=organizations.js.map