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

export type Listing<T extends { Listing: object }> = Selectable<T["Listing"]>;
export type ListingCreate<T extends { Listing: object }> = Insertable<T["Listing"]>;
export type ListingUpdate<T extends { Listing: object }> = Updateable<T["Listing"]>;

export type SalesPaymentTerm<T extends { SalesPaymentTerm: object }> = Selectable<
  T["SalesPaymentTerm"]
>;
export type SalesPaymentTermCreate<T extends { SalesPaymentTerm: object }> = Insertable<
  T["SalesPaymentTerm"]
>;
export type SalesPaymentTermUpdate<T extends { SalesPaymentTerm: object }> = Updateable<
  T["SalesPaymentTerm"]
>;

export type SalesPriceList<T extends { SalesPriceList: object }> = Selectable<T["SalesPriceList"]>;
export type SalesPriceListCreate<T extends { SalesPriceList: object }> = Insertable<
  T["SalesPriceList"]
>;
export type SalesPriceListUpdate<T extends { SalesPriceList: object }> = Updateable<
  T["SalesPriceList"]
>;

export type SalesPriceRule<T extends { SalesPriceRule: object }> = Selectable<T["SalesPriceRule"]>;
export type SalesPriceRuleCreate<T extends { SalesPriceRule: object }> = Insertable<
  T["SalesPriceRule"]
>;
export type SalesPriceRuleUpdate<T extends { SalesPriceRule: object }> = Updateable<
  T["SalesPriceRule"]
>;

export type SalesOrder<T extends { SalesOrder: object }> = Selectable<T["SalesOrder"]>;
export type SalesOrderCreate<T extends { SalesOrder: object }> = Insertable<T["SalesOrder"]>;
export type SalesOrderUpdate<T extends { SalesOrder: object }> = Updateable<T["SalesOrder"]>;

export type SalesOrderLine<T extends { SalesOrderLine: object }> = Selectable<T["SalesOrderLine"]>;
export type SalesOrderLineCreate<T extends { SalesOrderLine: object }> = Insertable<
  T["SalesOrderLine"]
>;
export type SalesOrderLineUpdate<T extends { SalesOrderLine: object }> = Updateable<
  T["SalesOrderLine"]
>;

export type Shipment<T extends { Shipment: object }> = Selectable<T["Shipment"]>;
export type ShipmentCreate<T extends { Shipment: object }> = Insertable<T["Shipment"]>;
export type ShipmentUpdate<T extends { Shipment: object }> = Updateable<T["Shipment"]>;

export type ShipmentLine<T extends { ShipmentLine: object }> = Selectable<T["ShipmentLine"]>;
export type ShipmentLineCreate<T extends { ShipmentLine: object }> = Insertable<T["ShipmentLine"]>;
export type ShipmentLineUpdate<T extends { ShipmentLine: object }> = Updateable<T["ShipmentLine"]>;

export type SalesInvoice<T extends { SalesInvoice: object }> = Selectable<T["SalesInvoice"]>;
export type SalesInvoiceCreate<T extends { SalesInvoice: object }> = Insertable<T["SalesInvoice"]>;
export type SalesInvoiceUpdate<T extends { SalesInvoice: object }> = Updateable<T["SalesInvoice"]>;

export type SalesInvoiceLine<T extends { SalesInvoiceLine: object }> = Selectable<
  T["SalesInvoiceLine"]
>;
export type SalesInvoiceLineCreate<T extends { SalesInvoiceLine: object }> = Insertable<
  T["SalesInvoiceLine"]
>;
export type SalesInvoiceLineUpdate<T extends { SalesInvoiceLine: object }> = Updateable<
  T["SalesInvoiceLine"]
>;

export type SalesCreditNote<T extends { SalesCreditNote: object }> = Selectable<
  T["SalesCreditNote"]
>;
export type SalesCreditNoteCreate<T extends { SalesCreditNote: object }> = Insertable<
  T["SalesCreditNote"]
>;
export type SalesCreditNoteUpdate<T extends { SalesCreditNote: object }> = Updateable<
  T["SalesCreditNote"]
>;

export type SalesCreditNoteLine<T extends { SalesCreditNoteLine: object }> = Selectable<
  T["SalesCreditNoteLine"]
>;
export type SalesCreditNoteLineCreate<T extends { SalesCreditNoteLine: object }> = Insertable<
  T["SalesCreditNoteLine"]
>;
export type SalesCreditNoteLineUpdate<T extends { SalesCreditNoteLine: object }> = Updateable<
  T["SalesCreditNoteLine"]
>;

export type ChannelOrder<T extends { ChannelOrder: object }> = Selectable<T["ChannelOrder"]>;
export type ChannelOrderCreate<T extends { ChannelOrder: object }> = Insertable<T["ChannelOrder"]>;
export type ChannelOrderUpdate<T extends { ChannelOrder: object }> = Updateable<T["ChannelOrder"]>;

export type SyncJob<T extends { SyncJob: object }> = Selectable<T["SyncJob"]>;
export type SyncJobCreate<T extends { SyncJob: object }> = Insertable<T["SyncJob"]>;
export type SyncJobUpdate<T extends { SyncJob: object }> = Updateable<T["SyncJob"]>;
