import type { Database } from "./database.types.js";
import type { EventInsertInTablo } from "./events.types.js";
import type { RemoveNullFromObject } from "./utils.js";

export type UserTablo = RemoveNullFromObject<
  Database["public"]["Views"]["user_tablos"]["Row"],
  | "id"
  | "access_level"
  | "is_admin"
  | "created_at"
  | "deleted_at"
  | "position"
  | "user_id"
  | "name"
  | "status"
>;

export type Tablo = Database["public"]["Tables"]["tablos"];

export type TabloInsert = Tablo["Insert"];
export type TabloUpdate = Tablo["Update"];

export type CreateTablo = Pick<TabloInsert, "name" | "color" | "image" | "status"> & {
  events?: EventInsertInTablo[];
};
