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

export type Schema = InferSchema<DB>;

export type Product<T extends { Product: object }> = Selectable<T["Product"]>;
export type ProductCreate<T extends { Product: object }> = Insertable<T["Product"]>;
export type ProductUpdate<T extends { Product: object }> = Updateable<T["Product"]>;

export type ProductAttribute<T extends { ProductAttribute: object }> = Selectable<
  T["ProductAttribute"]
>;
export type ProductAttributeCreate<T extends { ProductAttribute: object }> = Insertable<
  T["ProductAttribute"]
>;
export type ProductAttributeUpdate<T extends { ProductAttribute: object }> = Updateable<
  T["ProductAttribute"]
>;

export type ProductAttributeValue<T extends { ProductAttributeValue: object }> = Selectable<
  T["ProductAttributeValue"]
>;
export type ProductAttributeValueCreate<T extends { ProductAttributeValue: object }> = Insertable<
  T["ProductAttributeValue"]
>;

export type ProductAttributeAssignment<T extends { ProductAttributeAssignment: object }> =
  Selectable<T["ProductAttributeAssignment"]>;
export type ProductAttributeAssignmentCreate<T extends { ProductAttributeAssignment: object }> =
  Insertable<T["ProductAttributeAssignment"]>;

export type ProductCategory<T extends { ProductCategory: object }> = Selectable<
  T["ProductCategory"]
>;
export type ProductCategoryCreate<T extends { ProductCategory: object }> = Insertable<
  T["ProductCategory"]
>;
export type ProductCategoryUpdate<T extends { ProductCategory: object }> = Updateable<
  T["ProductCategory"]
>;

export type ProductCategoryAssignment<T extends { ProductCategoryAssignment: object }> = Selectable<
  T["ProductCategoryAssignment"]
>;
export type ProductCategoryAssignmentCreate<T extends { ProductCategoryAssignment: object }> =
  Insertable<T["ProductCategoryAssignment"]>;

export type ProductVariant<T extends { ProductVariant: object }> = Selectable<T["ProductVariant"]>;
export type ProductVariantCreate<T extends { ProductVariant: object }> = Insertable<
  T["ProductVariant"]
>;
