import { C as Container, R as Result, M as MemberResolver } from '../resolver-DXtfO0qV.js'; import { ClockInError } from '../errors/index.js'; import { AnyDocument, ValidationResult, CheckInParams, CheckInResult, BulkCheckInData, OperationContext, BulkOperationResult, CheckOutParams, CheckOutResult, CheckInData, ToggleResult, CheckoutExpiredParams, CheckoutExpiredResult, ObjectIdLike, OccupancyData, ActiveSessionData, DashboardParams, DashboardResult, HistoryParams, AttendanceRecord, DailyTrendEntry, PeriodStats, SubmitCorrectionRequestParams, CorrectionRequest, ListCorrectionRequestsParams, ReviewCorrectionRequestParams, ApplyCorrectionRequestParams } from '../types.js'; import mongoose, { ClientSession } from 'mongoose'; /** * ClockIn Check-In Service * * Handles all check-in operations with full TypeScript support * * @module @classytic/clockin/services/checkin */ /** * Check-In Service * * Provides type-safe check-in operations */ declare class CheckInService { private container; private logger; constructor(container: Container); /** * Get model from container (supports multi-connection setups) * No fallbacks: models must be registered via .withModels() */ private getModel; /** * Create plugin context for an operation (reusable across hooks) */ private createPluginContext; /** * Validate targetModel against allowlist (if configured). * Throws TargetModelNotAllowedError if not allowed. */ private validateTargetModelAllowed; /** * Validate if member can check in */ validate(member: TMember | null | undefined, targetModel: string, options?: { timestamp?: Date; }): ValidationResult; /** * Record a check-in * * @example * ```typescript * const result = await checkInService.record({ * member, * targetModel: 'Membership', * data: { method: 'qr_code' }, * context: { organizationId }, * }); * * if (isOk(result)) { * console.log(`Total visits: ${result.value.stats.totalVisits}`); * } * ``` */ record(params: CheckInParams): Promise>; /** * Bulk check-in (for data imports) * * Supports pluggable member resolution via the `resolver` option. * If no resolver is provided, uses the container-registered resolver * or falls back to DefaultMemberResolver. * * @example * ```typescript * // Use default resolver (tries email, membershipCode, employeeId, _id) * await checkInService.recordBulk(checkIns, context); * * // Use custom identifier fields * await checkInService.recordBulk(checkIns, context, { * resolver: new DefaultMemberResolver(container, { * identifierFields: ['membershipCode', 'employeeId'], * }), * }); * * // Use completely custom resolver * await checkInService.recordBulk(checkIns, context, { * resolver: myCustomResolver, * }); * ``` */ recordBulk(checkIns: BulkCheckInData[], context?: OperationContext, options?: { resolver?: MemberResolver; }): Promise; private createCheckInEntry; private calculateStats; private checkMilestones; } /** * ClockIn Check-Out Service * * Handles all check-out operations with full TypeScript support * * @module @classytic/clockin/services/checkout */ /** * Check-Out Service * * Provides type-safe check-out operations */ declare class CheckOutService { private container; private logger; constructor(container: Container); /** * Get model from container (supports multi-connection setups) * No fallbacks: models must be registered via .withModels() */ private getModel; /** * Create plugin context for an operation */ private createPluginContext; /** * Validate targetModel against allowlist (if configured). * Throws TargetModelNotAllowedError if not allowed. */ private validateTargetModelAllowed; /** * Record a check-out */ record(params: CheckOutParams): Promise>; /** * Toggle check-in/out (smart action based on current state) * * Perfect for: * - RFID card tap * - QR code scan * - Biometric scan * - Mobile app tap */ toggle(params: { member: TMember; targetModel: string; data?: CheckInData; context?: OperationContext; }): Promise>; /** * Batch check-out for expired sessions */ checkoutExpired(params: CheckoutExpiredParams): Promise>; /** * Get current occupancy (who's checked in right now) */ getOccupancy(params: { organizationId: ObjectIdLike; targetModel?: string; }): Promise>; /** * Get member's current active session */ getCurrentSession(params: { memberId: ObjectIdLike; organizationId: ObjectIdLike; targetModel: string; }): Promise>; } /** * ClockIn Analytics Service * * Handles all analytics and reporting operations * * @module @classytic/clockin/services/analytics */ /** * Analytics Service * * Provides attendance analytics and reporting */ declare class AnalyticsService { private container; private logger; constructor(container: Container); /** * Get dashboard analytics */ dashboard(params: DashboardParams): Promise>; /** * Get member attendance history */ history(params: HistoryParams): Promise>; /** * Get daily attendance trend */ dailyTrend(params: { organizationId: ObjectIdLike; days?: number; targetModel?: string; }): Promise>; /** * Get period statistics */ periodStats(params: { organizationId: ObjectIdLike; year: number; month: number; targetModel?: string; }): Promise>; /** * Get time slot distribution */ timeSlotDistribution(params: { organizationId: ObjectIdLike; startDate?: Date; endDate?: Date; }): Promise, ClockInError>>; /** * Recalculate stats for members * * @param params.session - Optional MongoDB session for transaction support */ recalculateStats(params: { MemberModel: mongoose.Model; organizationId: ObjectIdLike; memberIds?: ObjectIdLike[]; session?: ClientSession; }): Promise>; private getSummary; private getEngagementDistribution; private getTopMembers; private getAtRiskMembers; } /** * ClockIn Correction Request Service * * Handles correction request lifecycle: submit, list, review, apply * * @module @classytic/clockin/services/corrections */ /** * Correction Request Service * * Provides type-safe correction request operations */ declare class CorrectionRequestService { private container; constructor(container: Container); private toObjectId; private getOrganizationId; private attachCorrection; private recomputeWorkdayCounts; /** * Submit a correction request */ submit(params: SubmitCorrectionRequestParams): Promise>; /** * List correction requests */ list(params: ListCorrectionRequestsParams): Promise>; /** * Review a correction request (approve or reject) */ review(params: ReviewCorrectionRequestParams): Promise>; /** * Apply an approved correction request */ apply(params: ApplyCorrectionRequestParams): Promise>; } type CorrectionsProvider = CorrectionRequestService | { corrections: CorrectionRequestService; }; declare function submitCorrectionRequest(provider: CorrectionsProvider, params: SubmitCorrectionRequestParams): Promise>; declare function listCorrectionRequests(provider: CorrectionsProvider, params: ListCorrectionRequestsParams): Promise>; declare function reviewCorrectionRequest(provider: CorrectionsProvider, params: ReviewCorrectionRequestParams): Promise>; declare function applyCorrectionRequest(provider: CorrectionsProvider, params: ApplyCorrectionRequestParams): Promise>; export { AnalyticsService, CheckInService, CheckOutService, CorrectionRequestService, applyCorrectionRequest, listCorrectionRequests, reviewCorrectionRequest, submitCorrectionRequest };