import { createGetDB, type Generated, type Timestamp, type ObjectColumnType, type NamespaceDB, type NamespaceInsertable, type NamespaceSelectable, type NamespaceTable, type NamespaceTableName, type NamespaceTransaction, type NamespaceUpdateable, } from "@tailor-platform/sdk/kysely"; export interface Namespace { "main-db": { AccrualPlan: { id: Generated; leaveTypeKey: string; accrualMethod: "FRONT_LOAD_TENURE"; grantType: "STATUTORY" | "MANUAL"; eligibilityDelayMonths: number; baseGrantDays: string; tenureTiers: { yearsOfService: number; grantDays: number; }[]; grantCondition: ObjectColumnType<{ type: "NONE" | "MIN_WORKED_DAYS"; minWorkedDays?: number | null; referenceMonths?: number | null; }> | null; annualCapDays: string | null; expirationMonths: number; appliesToEmploymentTypeId: string | null; effectiveStart: Timestamp; effectiveEnd: Timestamp | null; versionOf: string; createdAt: Generated; updatedAt: Generated; } LeaveConsumption: { id: Generated; leaveRequestId: string; leaveGrantId: string; daysConsumed: string; restoredAt: Timestamp | null; createdAt: Generated; updatedAt: Generated; } LeaveGrant: { id: Generated; workerId: string; leaveTypeKey: string; grantType: "STATUTORY" | "COMPENSATORY" | "MANUAL"; grantSource: "HIRE" | "ANNIVERSARY" | "MANUAL"; grantedDays: string; remainingDays: string; grantedDate: Timestamp; expirationDate: Timestamp; expiredAt: Timestamp | null; createdAt: Generated; updatedAt: Generated; } LeaveRequest: { id: Generated; workerId: string; assignmentId: string; leaveTypeKey: string; startDate: Timestamp; endDate: Timestamp; reason: string; status: "PENDING" | "APPROVED" | "REJECTED" | "CANCELLED" | "CANCEL_PENDING"; resolvedAt: Timestamp | null; resolvedBy: string | null; targetEntityId: string; createdAt: Generated; updatedAt: Generated; } LeaveType: { id: Generated; key: string; displayName: string; category: string; requiresBalance: boolean; drawsFromCompensatoryGrants: boolean | null; timeEntryCodeKey: string; isActive: boolean; requestUnit: "FULL_DAY" | "HALF_DAY" | "RANGE" | 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;