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

export type Routing<T extends { Routing: object }> = Selectable<T["Routing"]>;
export type RoutingCreate<T extends { Routing: object }> = Insertable<T["Routing"]>;
export type RoutingUpdate<T extends { Routing: object }> = Updateable<T["Routing"]>;

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

export type BillOfMaterial<T extends { BillOfMaterial: object }> = Selectable<T["BillOfMaterial"]>;
export type BillOfMaterialCreate<T extends { BillOfMaterial: object }> = Insertable<
  T["BillOfMaterial"]
>;
export type BillOfMaterialUpdate<T extends { BillOfMaterial: object }> = Updateable<
  T["BillOfMaterial"]
>;

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

export type ProductionOrder<T extends { ProductionOrder: object }> = Selectable<
  T["ProductionOrder"]
>;
export type ProductionOrderCreate<T extends { ProductionOrder: object }> = Insertable<
  T["ProductionOrder"]
>;
export type ProductionOrderUpdate<T extends { ProductionOrder: object }> = Updateable<
  T["ProductionOrder"]
>;

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

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

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

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

export type WorkOrder<T extends { WorkOrder: object }> = Selectable<T["WorkOrder"]>;
export type WorkOrderCreate<T extends { WorkOrder: object }> = Insertable<T["WorkOrder"]>;
export type WorkOrderUpdate<T extends { WorkOrder: object }> = Updateable<T["WorkOrder"]>;

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

export type ManufacturingCostSummary<T extends { ManufacturingCostSummary: object }> = Selectable<
  T["ManufacturingCostSummary"]
>;
export type ManufacturingCostSummaryCreate<T extends { ManufacturingCostSummary: object }> =
  Insertable<T["ManufacturingCostSummary"]>;
export type ManufacturingCostSummaryUpdate<T extends { ManufacturingCostSummary: object }> =
  Updateable<T["ManufacturingCostSummary"]>;

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

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

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