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

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

export type PartnerAddress<T extends { PartnerAddress: object }> = Selectable<T["PartnerAddress"]>;
export type PartnerAddressCreate<T extends { PartnerAddress: object }> = Insertable<
  T["PartnerAddress"]
>;
export type PartnerAddressUpdate<T extends { PartnerAddress: object }> = Updateable<
  T["PartnerAddress"]
>;

export type ContactPerson<T extends { ContactPerson: object }> = Selectable<T["ContactPerson"]>;
export type ContactPersonCreate<T extends { ContactPerson: object }> = Insertable<
  T["ContactPerson"]
>;
export type ContactPersonUpdate<T extends { ContactPerson: object }> = Updateable<
  T["ContactPerson"]
>;

export type PartnerBankAccount<T extends { PartnerBankAccount: object }> = Selectable<
  T["PartnerBankAccount"]
>;
export type PartnerBankAccountCreate<T extends { PartnerBankAccount: object }> = Insertable<
  T["PartnerBankAccount"]
>;
export type PartnerBankAccountUpdate<T extends { PartnerBankAccount: object }> = Updateable<
  T["PartnerBankAccount"]
>;

export type PartnerIdentification<T extends { PartnerIdentification: object }> = Selectable<
  T["PartnerIdentification"]
>;
export type PartnerIdentificationCreate<T extends { PartnerIdentification: object }> = Insertable<
  T["PartnerIdentification"]
>;
export type PartnerIdentificationUpdate<T extends { PartnerIdentification: object }> = Updateable<
  T["PartnerIdentification"]
>;
