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

export type AccountingPeriod<T extends { AccountingPeriod: object }> = Selectable<
  T["AccountingPeriod"]
>;
export type AccountingPeriodCreate<T extends { AccountingPeriod: object }> = Insertable<
  T["AccountingPeriod"]
>;
export type AccountingPeriodUpdate<T extends { AccountingPeriod: object }> = Updateable<
  T["AccountingPeriod"]
>;

export type JournalEntry<T extends { JournalEntry: object }> = Selectable<T["JournalEntry"]>;
export type JournalEntryCreate<T extends { JournalEntry: object }> = Insertable<T["JournalEntry"]>;
export type JournalEntryUpdate<T extends { JournalEntry: object }> = Updateable<T["JournalEntry"]>;

export type JournalLine<T extends { JournalLine: object }> = Selectable<T["JournalLine"]>;
export type JournalLineCreate<T extends { JournalLine: object }> = Insertable<T["JournalLine"]>;
export type JournalLineUpdate<T extends { JournalLine: object }> = Updateable<T["JournalLine"]>;
