import type {
  InferSchema,
  Selectable,
  Insertable,
  Updateable,
} from "@tailor-platform/erp-kit/module";
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"]>;

export type PeriodClose<T extends { PeriodClose: object }> = Selectable<T["PeriodClose"]>;
export type PeriodCloseCreate<T extends { PeriodClose: object }> = Insertable<T["PeriodClose"]>;
export type PeriodCloseUpdate<T extends { PeriodClose: object }> = Updateable<T["PeriodClose"]>;

export type TrialBalance<T extends { TrialBalance: object }> = Selectable<T["TrialBalance"]>;
export type TrialBalanceCreate<T extends { TrialBalance: object }> = Insertable<T["TrialBalance"]>;
export type TrialBalanceUpdate<T extends { TrialBalance: object }> = Updateable<T["TrialBalance"]>;

export type TrialBalanceLine<T extends { TrialBalanceLine: object }> = Selectable<
  T["TrialBalanceLine"]
>;
export type TrialBalanceLineCreate<T extends { TrialBalanceLine: object }> = Insertable<
  T["TrialBalanceLine"]
>;
export type TrialBalanceLineUpdate<T extends { TrialBalanceLine: object }> = Updateable<
  T["TrialBalanceLine"]
>;

export type FinancialStatement<T extends { FinancialStatement: object }> = Selectable<
  T["FinancialStatement"]
>;
export type FinancialStatementCreate<T extends { FinancialStatement: object }> = Insertable<
  T["FinancialStatement"]
>;
export type FinancialStatementUpdate<T extends { FinancialStatement: object }> = Updateable<
  T["FinancialStatement"]
>;

export type FinancialStatementLineItem<T extends { FinancialStatementLineItem: object }> =
  Selectable<T["FinancialStatementLineItem"]>;
export type FinancialStatementLineItemCreate<T extends { FinancialStatementLineItem: object }> =
  Insertable<T["FinancialStatementLineItem"]>;
export type FinancialStatementLineItemUpdate<T extends { FinancialStatementLineItem: object }> =
  Updateable<T["FinancialStatementLineItem"]>;
