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

export type CostCenter<T extends { CostCenter: object }> = Selectable<T["CostCenter"]>;
export type CostCenterCreate<T extends { CostCenter: object }> = Insertable<T["CostCenter"]>;
export type CostCenterUpdate<T extends { CostCenter: object }> = Updateable<T["CostCenter"]>;

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

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

export type ProfitCenter<T extends { ProfitCenter: object }> = Selectable<T["ProfitCenter"]>;
export type ProfitCenterCreate<T extends { ProfitCenter: object }> = Insertable<T["ProfitCenter"]>;
export type ProfitCenterUpdate<T extends { ProfitCenter: object }> = Updateable<T["ProfitCenter"]>;

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

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

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

export type InternalOrder<T extends { InternalOrder: object }> = Selectable<T["InternalOrder"]>;
export type InternalOrderCreate<T extends { InternalOrder: object }> = Insertable<
  T["InternalOrder"]
>;
export type InternalOrderUpdate<T extends { InternalOrder: object }> = Updateable<
  T["InternalOrder"]
>;

export type AllocationCycle<T extends { AllocationCycle: object }> = Selectable<
  T["AllocationCycle"]
>;
export type AllocationCycleCreate<T extends { AllocationCycle: object }> = Insertable<
  T["AllocationCycle"]
>;
export type AllocationCycleUpdate<T extends { AllocationCycle: object }> = Updateable<
  T["AllocationCycle"]
>;

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

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

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

export type Budget<T extends { Budget: object }> = Selectable<T["Budget"]>;
export type BudgetCreate<T extends { Budget: object }> = Insertable<T["Budget"]>;
export type BudgetUpdate<T extends { Budget: object }> = Updateable<T["Budget"]>;

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

export type Commitment<T extends { Commitment: object }> = Selectable<T["Commitment"]>;
export type CommitmentCreate<T extends { Commitment: object }> = Insertable<T["Commitment"]>;
export type CommitmentUpdate<T extends { Commitment: object }> = Updateable<T["Commitment"]>;

export type VarianceReport<T extends { VarianceReport: object }> = Selectable<T["VarianceReport"]>;
export type VarianceReportCreate<T extends { VarianceReport: object }> = Insertable<
  T["VarianceReport"]
>;
export type VarianceReportUpdate<T extends { VarianceReport: object }> = Updateable<
  T["VarianceReport"]
>;

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