import { createGetDB, type Generated, type Timestamp, type ObjectColumnType, type ArrayColumnType, type NamespaceDB, type NamespaceInsertable, type NamespaceSelectable, type NamespaceTable, type NamespaceTableName, type NamespaceTransaction, type NamespaceUpdateable, } from "@tailor-platform/sdk/kysely"; export interface Namespace { "main-db": { CalculatedTimeBlock: { id: Generated; assignmentId: string; workDate: Timestamp; category: string; startAt: Timestamp; endAt: Timestamp; minutes: number; timeEntryCodeKey: string; payCodeKey: string; workRuleId: string; calculationTagKeys: string[]; sourceReportedBlockIds: string[]; createdAt: Generated; updatedAt: Generated; } CompanyHoliday: { id: Generated; calendarId: string; holidayDate: Timestamp; holidayKind: "STATUTORY" | "PRESCRIBED"; name: string; createdAt: Generated; updatedAt: Generated; } EligibilityRule: { id: Generated; targetType: "WORKER" | "POSITION" | "JOB_PROFILE" | "EMPLOYMENT_TYPE" | "WORK_REGIME"; targetId: string; grantType: "WORK_RULE"; workRuleId: string | null; effectiveStart: Timestamp; effectiveEnd: Timestamp | null; versionOf: string; createdAt: Generated; updatedAt: Generated; } HolidayCalendar: { id: Generated; key: string; name: string; createdAt: Generated; updatedAt: Generated; } ReportedTimeBlock: { id: Generated; assignmentId: string; workDate: Timestamp; blockType: "WORK" | "BREAK" | "STEP_OUT"; sourceKind: "PUNCH_DERIVED" | "MANUAL" | "IMPORT"; startAt: Timestamp; endAt: Timestamp; correctionReason: string | null; supersededByBlockId: string | null; createdAt: Generated; updatedAt: Generated; } TimeClockEvent: { id: Generated; assignmentId: string; eventType: "CLOCK_IN" | "CLOCK_OUT" | "BREAK_START" | "BREAK_END" | "STEP_OUT" | "STEP_IN"; occurredAt: Timestamp; source: string; createdAt: Generated; updatedAt: Generated; } TimeClockEventVoid: { id: Generated; targetEventId: string; action: "VOID" | "UNVOID"; sequence: number; actorId: string; occurredAt: Timestamp; reasonCode: "DUPLICATE" | "WRONG_PERSON" | "DEVICE_ERROR" | "MISTAKE" | "OTHER"; reasonNote: string; authority: "SELF" | "MANAGER" | "ADMIN"; createdAt: Generated; updatedAt: Generated; } TimeCorrectionLog: { id: Generated; timecardId: string; targetReportedBlockId: string | null; field: string; previousValue: string; newValue: string; reason: string; correctedBy: string; correctedAt: Timestamp; createdAt: Generated; updatedAt: Generated; } TimeEntryCode: { id: Generated; key: string; category: string; displayName: string; payMapKey: string; createdAt: Generated; updatedAt: Generated; } Timecard: { id: Generated; assignmentId: string; periodStart: Timestamp; periodEnd: Timestamp; status: "OPEN" | "SUBMITTED" | "APPROVED" | "LOCKED"; categoryTotals: { category: string; minutes: number; }[]; submittedAt: Timestamp | null; approvedAt: Timestamp | null; approvedBy: string | null; lockedAt: Timestamp | null; lockedBy: string | null; historicalCorrection: boolean; createdAt: Generated; updatedAt: Generated; } WorkRule: { id: Generated; displayName: string; holidayCalendarId: string | null; clockInRoundingUnitMinutes: number; clockInRoundingDirection: "UP" | "DOWN" | "NEAREST"; clockOutRoundingUnitMinutes: number; clockOutRoundingDirection: "UP" | "DOWN" | "NEAREST"; breakRoundingUnitMinutes: number; breakRoundingDirection: "UP" | "DOWN" | "NEAREST"; breakDeductionMinutes: number; dailyOvertimeThresholdMinutes: number; nightWindowStart: number; nightWindowEnd: number; premiumRatePercent: ArrayColumnType>; effectiveStart: Timestamp; effectiveEnd: Timestamp | null; versionOf: string; createdAt: Generated; updatedAt: Generated; } WorkRuleAssignment: { id: Generated; targetType: "WORKER" | "POSITION" | "JOB_PROFILE" | "EMPLOYMENT_TYPE" | "WORK_REGIME"; targetId: string; workRuleId: string; 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;