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 SupplierProfile<T extends { SupplierProfile: object }> = Selectable<
  T["SupplierProfile"]
>;
export type SupplierProfileCreate<T extends { SupplierProfile: object }> = Insertable<
  T["SupplierProfile"]
>;
export type SupplierProfileUpdate<T extends { SupplierProfile: object }> = Updateable<
  T["SupplierProfile"]
>;

export type PurchasePaymentTerm<T extends { PurchasePaymentTerm: object }> = Selectable<
  T["PurchasePaymentTerm"]
>;
export type PurchasePaymentTermCreate<T extends { PurchasePaymentTerm: object }> = Insertable<
  T["PurchasePaymentTerm"]
>;
export type PurchasePaymentTermUpdate<T extends { PurchasePaymentTerm: object }> = Updateable<
  T["PurchasePaymentTerm"]
>;

export type PurchasePriceList<T extends { PurchasePriceList: object }> = Selectable<
  T["PurchasePriceList"]
>;
export type PurchasePriceListCreate<T extends { PurchasePriceList: object }> = Insertable<
  T["PurchasePriceList"]
>;
export type PurchasePriceListUpdate<T extends { PurchasePriceList: object }> = Updateable<
  T["PurchasePriceList"]
>;

export type PurchasePriceRule<T extends { PurchasePriceRule: object }> = Selectable<
  T["PurchasePriceRule"]
>;
export type PurchasePriceRuleCreate<T extends { PurchasePriceRule: object }> = Insertable<
  T["PurchasePriceRule"]
>;
export type PurchasePriceRuleUpdate<T extends { PurchasePriceRule: object }> = Updateable<
  T["PurchasePriceRule"]
>;

export type PurchaseOrder<T extends { PurchaseOrder: object }> = Selectable<T["PurchaseOrder"]>;
export type PurchaseOrderCreate<T extends { PurchaseOrder: object }> = Insertable<
  T["PurchaseOrder"]
>;
export type PurchaseOrderUpdate<T extends { PurchaseOrder: object }> = Updateable<
  T["PurchaseOrder"]
>;

export type GoodsReceipt<T extends { GoodsReceipt: object }> = Selectable<T["GoodsReceipt"]>;
export type GoodsReceiptCreate<T extends { GoodsReceipt: object }> = Insertable<T["GoodsReceipt"]>;
export type GoodsReceiptUpdate<T extends { GoodsReceipt: object }> = Updateable<T["GoodsReceipt"]>;

export type PurchaseBill<T extends { PurchaseBill: object }> = Selectable<T["PurchaseBill"]>;
export type PurchaseBillCreate<T extends { PurchaseBill: object }> = Insertable<T["PurchaseBill"]>;
export type PurchaseBillUpdate<T extends { PurchaseBill: object }> = Updateable<T["PurchaseBill"]>;
