import { PrismaClient } from '@prisma/client'; import { b as TimeEntry, c as Timesheet, R as RateCard, d as TimeCategory, e as TimeLock, A as AuditLog } from '../../types-ecK2b88Z.js'; import { C as CreateTimeEntryInput, U as UpdateTimeEntryInput, T as TimeEntryFilter, P as PaginationParams } from '../../schemas-ZDVMEZ9A.js'; import 'zod'; /** * Repository interfaces and Prisma implementations */ interface TimeEntryRepository { create(input: CreateTimeEntryInput): Promise; update(id: string, input: UpdateTimeEntryInput): Promise; delete(id: string): Promise; findById(id: string): Promise; findMany(filter: TimeEntryFilter): Promise<{ data: TimeEntry[]; total: number; }>; findOverlapping(developerId: string, startAt: Date, endAt: Date, excludeId?: string): Promise; } interface TimesheetRepository { generate(developerId: string, clientId: string, periodStart: Date, periodEnd: Date): Promise; findById(id: string): Promise; findMany(filter: PaginationParams & { developerId?: string; clientId?: string; }): Promise<{ data: Timesheet[]; total: number; }>; submit(id: string): Promise; approve(id: string, approvedBy: string): Promise; reject(id: string, rejectedBy: string, reason: string): Promise; } interface RateCardRepository { create(input: Omit): Promise; update(id: string, input: Partial): Promise; findById(id: string): Promise; findEffective(params: { developerId?: string; projectId?: string; clientId?: string; date: Date; }): Promise; findMany(filter: PaginationParams): Promise<{ data: RateCard[]; total: number; }>; } interface TimeCategoryRepository { create(input: Omit): Promise; update(id: string, input: Partial): Promise; findById(id: string): Promise; findAll(): Promise; } interface TimeLockRepository { create(input: Omit): Promise; unlock(id: string, unlockedBy: string): Promise; findActive(projectId?: string, clientId?: string): Promise; checkLocked(params: { projectId?: string; clientId?: string; startAt: Date; endAt: Date; }): Promise; } interface AuditLogRepository { create(input: Omit): Promise; findMany(filter: { entityType?: string; entityId?: string; userId?: string; } & PaginationParams): Promise<{ data: AuditLog[]; total: number; }>; } /** * Create repository instances with Prisma client */ declare function createRepositories(prisma: PrismaClient): { timeEntry: TimeEntryRepository; timesheet: TimesheetRepository; rateCard: RateCardRepository; timeCategory: TimeCategoryRepository; timeLock: TimeLockRepository; auditLog: AuditLogRepository; }; /** * Mappers between Prisma models and domain types */ /** * Map Prisma TimeEntry to domain TimeEntry */ declare function mapPrismaToTimeEntry(prismaEntry: any): TimeEntry; /** * Map domain TimeEntry to Prisma create input */ declare function mapTimeEntryToPrismaCreate(entry: Partial): any; /** * Map domain TimeEntry to Prisma update input */ declare function mapTimeEntryToPrismaUpdate(entry: Partial): any; /** * Prisma client configuration for Time Log */ interface TimeLogPrismaConfig { prisma: PrismaClient; } /** * Create a configured Prisma client instance for Time Log */ declare function createTimeLogPrismaClient(config: TimeLogPrismaConfig): PrismaClient; export { type AuditLogRepository, type RateCardRepository, type TimeCategoryRepository, type TimeEntryRepository, type TimeLockRepository, type TimeLogPrismaConfig, type TimesheetRepository, createRepositories, createTimeLogPrismaClient, mapPrismaToTimeEntry, mapTimeEntryToPrismaCreate, mapTimeEntryToPrismaUpdate };