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": { PurchaseItem: { id: Generated; itemId: string; requiresPhysicalReceipt: boolean; createdAt: Generated; updatedAt: Generated; } PurchaseOrder: { id: Generated; companyId: string; supplierAccountId: string; currencyId: string; receivingSiteId: string | null; orderStatus: "DRAFT" | "SUBMITTED" | "ORDERED" | "CANCELLED" | "CLOSED"; receiptStatus: "NOT_RECEIVED" | "PARTIALLY_RECEIVED" | "RECEIVED" | null; billingStatus: "NOT_BILLED" | "PARTIALLY_BILLED" | "BILLED" | null; orderDate: Timestamp; externalSupplierOrderReference: string | null; supplierSnapshotName: string | null; rejectionReason: string | null; closeReason: string | null; createdAt: Generated; updatedAt: Generated; } PurchaseOrderFieldChange: { 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; } PurchaseOrderLine: { id: Generated; purchaseOrderId: string; itemId: string; itemSnapshotName: string | null; itemSnapshotSku: string | null; quantity: string; unitPrice: string; unitId: string; receivingSiteId: string | null; requiresPhysicalReceipt: boolean; billedQuantity: Generated; receivedQuantity: Generated; createdAt: Generated; updatedAt: Generated; } PurchaseOrderRevision: { id: Generated; purchaseOrderId: 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;