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

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

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

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

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

export type InventoryAdjustment<T extends { InventoryAdjustment: object }> = Selectable<
  T["InventoryAdjustment"]
>;
export type InventoryAdjustmentCreate<T extends { InventoryAdjustment: object }> = Insertable<
  T["InventoryAdjustment"]
>;
export type InventoryAdjustmentUpdate<T extends { InventoryAdjustment: object }> = Updateable<
  T["InventoryAdjustment"]
>;

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"]>;
