import { eq } from "drizzle-orm";
import { database } from "~/database/context";
import * as schema from "~/database/schema";

export type AutodraftSetting = typeof schema.autodraftSettings.$inferSelect;

export async function getSeasonAutodraftSettings(seasonId: string): Promise<AutodraftSetting[]> {
  const db = database();
  return await db.query.autodraftSettings.findMany({
    where: eq(schema.autodraftSettings.seasonId, seasonId),
  });
}
