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": { AppointmentHistory: { id: Generated; workerId: string; assignmentId: string; fromPositionId: string | null; toPositionId: string | null; appointmentTypeId: string; effectiveDate: Timestamp; issuedAt: Timestamp; appliedAt: Timestamp | null; createdAt: Generated; updatedAt: Generated; } AppointmentType: { id: Generated; companyId: string; key: string; displayName: string; action: "CREATE_PRIMARY_ASSIGNMENT" | "CREATE_SECONDARY_ASSIGNMENT" | "CHANGE_ASSIGNMENT" | "END_ASSIGNMENT"; status: "ACTIVE" | "INACTIVE"; createdAt: Generated; updatedAt: Generated; } Assignment: { id: Generated; workerEmploymentId: string; positionId: string; isPrimary: boolean; effectiveStart: Timestamp; effectiveEnd: Timestamp | null; versionOf: string; createdAt: Generated; updatedAt: Generated; } EmploymentType: { id: Generated; companyId: string; key: string; displayName: string; status: "ACTIVE" | "INACTIVE"; createdAt: Generated; updatedAt: Generated; } JobProfile: { id: Generated; code: string; jobFamily: string; gradeReference: string; requirements: string | null; createdAt: Generated; updatedAt: Generated; } Position: { id: Generated; departmentId: string; siteId: string | null; jobProfileId: string; headcount: number; effectiveStart: Timestamp; effectiveEnd: Timestamp | null; versionOf: string; createdAt: Generated; updatedAt: Generated; } WorkRegime: { id: Generated; companyId: string; key: string; displayName: string; status: "ACTIVE" | "INACTIVE"; createdAt: Generated; updatedAt: Generated; } WorkSchedule: { id: Generated; assignmentId: string; scheduledDailyMinutes: number; scheduledWeeklyMinutes: number; effectiveStart: Timestamp; effectiveEnd: Timestamp | null; versionOf: string; createdAt: Generated; updatedAt: Generated; } Worker: { id: Generated; userId: string; workerCode: string; createdAt: Generated; updatedAt: Generated; } WorkerEmployment: { id: Generated; workerId: string; companyId: string; employmentTypeId: string; workRegimeId: string; hireDate: Timestamp; terminationDate: Timestamp | null; effectiveStart: Timestamp; effectiveEnd: Timestamp | null; versionOf: string; 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;