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

export type ValuationPolicy<T extends { ValuationPolicy: object }> = Selectable<
  T["ValuationPolicy"]
>;
export type ValuationPolicyCreate<T extends { ValuationPolicy: object }> = Insertable<
  T["ValuationPolicy"]
>;
export type ValuationPolicyUpdate<T extends { ValuationPolicy: object }> = Updateable<
  T["ValuationPolicy"]
>;

export type StockLevel<T extends { StockLevel: object }> = Selectable<T["StockLevel"]>;
export type StockLevelCreate<T extends { StockLevel: object }> = Insertable<T["StockLevel"]>;
export type StockLevelUpdate<T extends { StockLevel: object }> = Updateable<T["StockLevel"]>;
export type StockReservation<T extends { StockReservation: object }> = Selectable<
  T["StockReservation"]
>;
export type StockReservationCreate<T extends { StockReservation: object }> = Insertable<
  T["StockReservation"]
>;
export type StockReservationUpdate<T extends { StockReservation: object }> = Updateable<
  T["StockReservation"]
>;

export type Lot<T extends { Lot: object }> = Selectable<T["Lot"]>;
export type LotCreate<T extends { Lot: object }> = Insertable<T["Lot"]>;
export type LotUpdate<T extends { Lot: object }> = Updateable<T["Lot"]>;

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

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

export type StockAdjustment<T extends { StockAdjustment: object }> = Selectable<
  T["StockAdjustment"]
>;
export type StockAdjustmentCreate<T extends { StockAdjustment: object }> = Insertable<
  T["StockAdjustment"]
>;
export type StockAdjustmentUpdate<T extends { StockAdjustment: object }> = Updateable<
  T["StockAdjustment"]
>;

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

export type TransferOrder<T extends { TransferOrder: object }> = Selectable<T["TransferOrder"]>;
export type TransferOrderCreate<T extends { TransferOrder: object }> = Insertable<
  T["TransferOrder"]
>;
export type TransferOrderUpdate<T extends { TransferOrder: object }> = Updateable<
  T["TransferOrder"]
>;

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

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

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

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

export type InventoryExecution<T extends { InventoryExecution: object }> = Selectable<
  T["InventoryExecution"]
>;
export type InventoryExecutionCreate<T extends { InventoryExecution: object }> = Insertable<
  T["InventoryExecution"]
>;
export type InventoryExecutionUpdate<T extends { InventoryExecution: object }> = Updateable<
  T["InventoryExecution"]
>;
export type InventoryExecutionLine<T extends { InventoryExecutionLine: object }> = Selectable<
  T["InventoryExecutionLine"]
>;
export type InventoryExecutionLineCreate<T extends { InventoryExecutionLine: object }> = Insertable<
  T["InventoryExecutionLine"]
>;

export type InventorySupplyPlan<T extends { InventorySupplyPlan: object }> = Selectable<
  T["InventorySupplyPlan"]
>;
export type InventorySupplyPlanCreate<T extends { InventorySupplyPlan: object }> = Insertable<
  T["InventorySupplyPlan"]
>;
export type InventorySupplyPlanUpdate<T extends { InventorySupplyPlan: object }> = Updateable<
  T["InventorySupplyPlan"]
>;
