import type {
  InferSchema,
  Selectable,
  Insertable,
  Updateable,
} from "@tailor-platform/erp-kit/core";
import type { DB } from "../generated/kysely-tailordb";

export type Schema = InferSchema<DB>;

export type User<T extends { User: object }> = Selectable<T["User"]>;
export type UserCreate<T extends { User: object }> = Insertable<T["User"]>;
export type UserUpdate<T extends { User: object }> = Updateable<T["User"]>;

export type Role<T extends { Role: object }> = Selectable<T["Role"]>;
export type RoleCreate<T extends { Role: object }> = Insertable<T["Role"]>;
export type RoleUpdate<T extends { Role: object }> = Updateable<T["Role"]>;

export type UserRole<T extends { UserRole: object }> = Selectable<T["UserRole"]>;
export type UserRoleCreate<T extends { UserRole: object }> = Insertable<T["UserRole"]>;
export type UserRoleUpdate<T extends { UserRole: object }> = Updateable<T["UserRole"]>;
