import { createGetDB, type Generated, type Timestamp, type NamespaceDB, type NamespaceInsertable, type NamespaceSelectable, type NamespaceTable, type NamespaceTableName, type NamespaceTransaction, type NamespaceUpdateable, } from "@tailor-platform/sdk/kysely"; export interface Namespace { "main-db": { SalesItem: { id: Generated; itemId: string; requiresPhysicalFulfillment: boolean; createdAt: Generated; updatedAt: Generated; } SalesOrder: { id: Generated; companyId: string; customerAccountId: string; currencyId: string; orderStatus: "DRAFT" | "SUBMITTED" | "CONFIRMED" | "CANCELLED" | "CLOSED"; fulfillmentStatus: "NOT_FULFILLED" | "PARTIALLY_FULFILLED" | "FULFILLED" | null; billingStatus: "NOT_BILLED" | "PARTIALLY_BILLED" | "BILLED" | null; orderDate: Timestamp; shippingAddress: string | null; billingAddress: string | null; rejectionReason: string | null; closeReason: string | null; createdAt: Generated; updatedAt: Generated; } SalesOrderFieldChange: { id: Generated; revisionId: string; recordType: "HEADER" | "LINE"; recordId: string; fieldName: string; changeKind: "ADDED" | "MODIFIED" | "REMOVED"; oldValue: string | null; newValue: string | null; createdAt: Generated; updatedAt: Generated; } SalesOrderLine: { id: Generated; salesOrderId: string; itemId: string; description: string | null; quantity: string; unitPrice: string; unitId: string | null; requiresPhysicalFulfillment: boolean; fulfilledQuantity: Generated; billedQuantity: Generated; createdAt: Generated; updatedAt: Generated; } SalesOrderRevision: { id: Generated; salesOrderId: string; revisionNumber: number; reason: string | null; amendedByUserId: string | null; createdAt: Generated; updatedAt: Generated; } } } export const getDB = createGetDB(); export type DB = NamespaceDB; export type Transaction = NamespaceTransaction; type TableName = NamespaceTableName; export type Table = NamespaceTable; export type Insertable = NamespaceInsertable; export type Selectable = NamespaceSelectable; export type Updateable = NamespaceUpdateable;