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

export type AuditPolicy<T extends { AuditPolicy: object }> = Selectable<T["AuditPolicy"]>;
export type AuditPolicyCreate<T extends { AuditPolicy: object }> = Insertable<T["AuditPolicy"]>;
export type AuditPolicyUpdate<T extends { AuditPolicy: object }> = Updateable<T["AuditPolicy"]>;

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

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

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