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 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 PurchaseOrderLine<T extends { PurchaseOrderLine: object }> = Selectable<
  T["PurchaseOrderLine"]
>;
export type PurchaseOrderLineCreate<T extends { PurchaseOrderLine: object }> = Insertable<
  T["PurchaseOrderLine"]
>;

export type PurchaseRequisition<T extends { PurchaseRequisition: object }> = Selectable<
  T["PurchaseRequisition"]
>;
export type PurchaseRequisitionCreate<T extends { PurchaseRequisition: object }> = Insertable<
  T["PurchaseRequisition"]
>;
export type PurchaseRequisitionUpdate<T extends { PurchaseRequisition: object }> = Updateable<
  T["PurchaseRequisition"]
>;

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

export type PurchaseRequisitionLineAllocation<
  T extends { PurchaseRequisitionLineAllocation: object },
> = Selectable<T["PurchaseRequisitionLineAllocation"]>;
export type PurchaseRequisitionLineAllocationCreate<
  T extends { PurchaseRequisitionLineAllocation: object },
> = Insertable<T["PurchaseRequisitionLineAllocation"]>;

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

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