import { Logger, StreakResult, EngagementLevel, AttendanceStats, ClockInMember, ValidationResult, AttendanceTargetModel, CheckInMethod, ObjectIdLike, WorkSchedule, ScheduleCheckResult, WorkingDayResult, ScheduleThresholds, CheckInEntry, ObjectId, TargetModelConfig, AttendanceType } from '../types.js'; import 'mongoose'; /** * Logger Utility * * Injectable logger for ClockIn operations * Defaults to console, but can be replaced with any logger (pino, winston, etc.) * * @module @classytic/clockin/utils/logger */ /** * Get the current logger */ declare function getLogger(): Logger; /** * Set a custom logger * * @param logger - Custom logger instance (pino, winston, etc.) * * @example * ```typescript * import pino from 'pino'; * import { setLogger } from '@classytic/clockin'; * * setLogger(pino({ name: 'clockin' })); * ``` */ declare function setLogger(logger: Logger): void; /** * Reset to default logger */ declare function resetLogger(): void; /** * Create a child logger with prefix */ declare function createChildLogger(prefix: string): Logger; /** * Streak Calculator * * Pure functions for calculating attendance streaks * No side effects, fully testable * * @module @classytic/clockin/utils/streak */ /** * Calculate current and longest streak from check-in history * * @param checkIns - Array of check-in entries (any order) * @returns Streak result with current and longest streak * * @example * ```typescript * const { currentStreak, longestStreak } = calculateStreak(checkIns); * console.log(`Current: ${currentStreak} days, Best: ${longestStreak} days`); * ``` */ declare function calculateStreak(checkIns: Array<{ timestamp: Date | string; }>): StreakResult; /** * Check if streak milestone was reached * * @param streak - Current streak value * @returns Whether milestone reached * * @example * ```typescript * if (isStreakMilestone(7)) { * // Send 7-day streak notification * } * ``` */ declare function isStreakMilestone(streak: number): boolean; /** * Get next streak milestone * * @param currentStreak - Current streak * @returns Next milestone or null if none * * @example * ```typescript * const next = getNextStreakMilestone(5); * console.log(`${7 - 5} days until next milestone!`); * ``` */ declare function getNextStreakMilestone(currentStreak: number): number | null; /** * Calculate days until streak breaks * * @param lastVisitDate - Last check-in timestamp * @returns Days remaining (0 if already broken) * * @example * ```typescript * const daysLeft = daysUntilStreakBreaks(member.attendanceStats.lastVisitedAt); * if (daysLeft === 1) { * // Send "visit today to maintain streak" notification * } * ``` */ declare function daysUntilStreakBreaks(lastVisitDate: Date | string | null | undefined): number; /** * Get streak status for display * * @param currentStreak - Current streak * @param longestStreak - Longest streak * @returns Status object for UI */ declare function getStreakStatus(currentStreak: number, longestStreak: number): { current: number; longest: number; isNewRecord: boolean; nextMilestone: number | null; isMilestone: boolean; }; declare const _default$6: { calculateStreak: typeof calculateStreak; isStreakMilestone: typeof isStreakMilestone; getNextStreakMilestone: typeof getNextStreakMilestone; daysUntilStreakBreaks: typeof daysUntilStreakBreaks; getStreakStatus: typeof getStreakStatus; }; declare const streak_calculateStreak: typeof calculateStreak; declare const streak_daysUntilStreakBreaks: typeof daysUntilStreakBreaks; declare const streak_getNextStreakMilestone: typeof getNextStreakMilestone; declare const streak_getStreakStatus: typeof getStreakStatus; declare const streak_isStreakMilestone: typeof isStreakMilestone; declare namespace streak { export { streak_calculateStreak as calculateStreak, streak_daysUntilStreakBreaks as daysUntilStreakBreaks, _default$6 as default, streak_getNextStreakMilestone as getNextStreakMilestone, streak_getStreakStatus as getStreakStatus, streak_isStreakMilestone as isStreakMilestone }; } /** * Engagement Calculator * * Pure functions for calculating member engagement levels * * @module @classytic/clockin/utils/engagement */ /** * Calculate engagement level from visit counts * * Logic: * - Highly Active: 12+ visits/month * - Active: 8-11 visits/month * - Regular: 4-7 visits/month * - Occasional: 1-3 visits/month * - Inactive: 0 visits this month * - At Risk: No visit in 14+ days * - Dormant: No visit in 30+ days * * @param thisMonthVisits - Visits this month * @param lastVisitedAt - Last check-in timestamp * @returns Engagement level */ declare function calculateEngagementLevel(thisMonthVisits?: number, lastVisitedAt?: Date | string | null | undefined): EngagementLevel; /** * Calculate days since last visit * * @param lastVisitedAt - Last check-in timestamp * @returns Days since last visit */ declare function calculateDaysSinceLastVisit(lastVisitedAt: Date | string | null | undefined): number; /** * Calculate loyalty score (0-100) * * Based on multiple factors: * - Total visits (weight: 40%) * - Current streak (weight: 30%) * - Monthly consistency (weight: 20%) * - Tenure (weight: 10%) * * @param stats - Attendance stats * @returns Score 0-100 */ declare function calculateLoyaltyScore(stats?: Partial): number; /** * Calculate months since date * * @param date - Start date * @returns Months since date */ declare function calculateMonthsSince(date: Date | string | null | undefined): number; /** * Check if engagement level changed * * @param previousLevel - Previous engagement level * @param currentLevel - Current engagement level * @returns Whether changed */ declare function hasEngagementChanged(previousLevel: EngagementLevel | undefined, currentLevel: EngagementLevel): boolean; /** * Get engagement severity for alerting * * @param level - Engagement level * @returns Severity: 'critical' | 'warning' | 'good' | 'excellent' */ declare function getEngagementSeverity(level: EngagementLevel): 'critical' | 'warning' | 'good' | 'excellent'; /** * Get engagement color for UI * * @param level - Engagement level * @returns CSS color class or hex color */ declare function getEngagementColor(level: EngagementLevel): string; /** * Get engagement display text * * @param level - Engagement level * @returns Human-readable text */ declare function getEngagementDisplayText(level: EngagementLevel): string; declare const _default$5: { calculateEngagementLevel: typeof calculateEngagementLevel; calculateDaysSinceLastVisit: typeof calculateDaysSinceLastVisit; calculateLoyaltyScore: typeof calculateLoyaltyScore; calculateMonthsSince: typeof calculateMonthsSince; hasEngagementChanged: typeof hasEngagementChanged; getEngagementSeverity: typeof getEngagementSeverity; getEngagementColor: typeof getEngagementColor; getEngagementDisplayText: typeof getEngagementDisplayText; }; declare const engagement_calculateDaysSinceLastVisit: typeof calculateDaysSinceLastVisit; declare const engagement_calculateEngagementLevel: typeof calculateEngagementLevel; declare const engagement_calculateLoyaltyScore: typeof calculateLoyaltyScore; declare const engagement_calculateMonthsSince: typeof calculateMonthsSince; declare const engagement_getEngagementColor: typeof getEngagementColor; declare const engagement_getEngagementDisplayText: typeof getEngagementDisplayText; declare const engagement_getEngagementSeverity: typeof getEngagementSeverity; declare const engagement_hasEngagementChanged: typeof hasEngagementChanged; declare namespace engagement { export { engagement_calculateDaysSinceLastVisit as calculateDaysSinceLastVisit, engagement_calculateEngagementLevel as calculateEngagementLevel, engagement_calculateLoyaltyScore as calculateLoyaltyScore, engagement_calculateMonthsSince as calculateMonthsSince, _default$5 as default, engagement_getEngagementColor as getEngagementColor, engagement_getEngagementDisplayText as getEngagementDisplayText, engagement_getEngagementSeverity as getEngagementSeverity, engagement_hasEngagementChanged as hasEngagementChanged }; } /** * Validators * * Reusable validation functions for attendance operations * * @module @classytic/clockin/utils/validators */ /** * Validate check-in eligibility * * Checks: * - Member exists * - Membership is active * - Attendance is enabled * - Not already checked in recently * * @param member - Member document * @returns Validation result */ declare function validateCheckInEligibility>(member: T | null | undefined): ValidationResult; /** * Validate check-in timing (duplicate prevention) * * @param lastCheckIn - Last check-in timestamp * @returns Validation result with next allowed time */ declare function validateCheckInTiming(lastCheckIn: Date | string | null | undefined): ValidationResult; /** * Configuration for target model validation */ interface TargetModelValidationConfig { /** * Allowed target models. If empty/undefined, any non-empty string is accepted. * @default undefined (allow any) */ allowedTargetModels?: string[]; } /** * Validate target model. * * As of v2.0, this function supports custom target models via allowlist configuration. * If no allowlist is configured, any non-empty string is accepted. * * @param targetModel - Model name * @param config - Optional validation config with allowlist * @throws ValidationError if model is empty or not in allowlist (when configured) * * @example * ```typescript * // Allow any target model (default behavior) * validateTargetModel('CustomEvent'); * * // Restrict to specific models * validateTargetModel('CustomEvent', { * allowedTargetModels: ['Membership', 'Employee', 'CustomEvent'] * }); * ``` */ declare function validateTargetModel(targetModel: string | undefined, config?: TargetModelValidationConfig): asserts targetModel is AttendanceTargetModel; /** * Validate check-in method * * @param method - Check-in method * @throws ValidationError if method invalid */ declare function validateCheckInMethod(method: string | undefined): asserts method is CheckInMethod | undefined; /** * Validate organization/tenant ID * * @param organizationId - Tenant ID * @throws ValidationError if invalid */ declare function validateOrganizationId(organizationId: ObjectIdLike | undefined): asserts organizationId is ObjectIdLike; /** * Validate pagination parameters * * @param pagination - Pagination options * @throws ValidationError if invalid */ declare function validatePagination(pagination?: { page?: number; limit?: number; }): void; /** * Validate date range * * @param startDate - Start date * @param endDate - End date * @throws ValidationError if invalid */ declare function validateDateRange(startDate?: Date | null, endDate?: Date | null): void; /** * Validate year value * * @param year - Year value * @throws ValidationError if invalid */ declare function validateYear(year?: number): void; /** * Validate month value * * @param month - Month value (1-12) * @throws ValidationError if invalid */ declare function validateMonth(month?: number): void; /** * Validate member for check-in and throw appropriate errors * * @param member - Member document * @throws MemberNotFoundError, AttendanceNotEnabledError, InvalidMemberError */ declare function assertValidMember>(member: T | null | undefined): asserts member is T & ClockInMember; /** * Assert check-in timing is valid * * @param lastCheckIn - Last check-in timestamp * @throws DuplicateCheckInError if too soon */ declare function assertValidCheckInTiming(lastCheckIn: Date | string | null | undefined): void; /** * Check-in data validation configuration */ interface CheckInDataValidationConfig { /** Maximum notes length (default: 1000) */ maxNotesLength?: number; /** Whether to validate location data (default: true) */ validateLocation?: boolean; } /** * Validate check-in data object * * Validates: * - method (if provided, must be valid CheckInMethod) * - timestamp (if provided, must be valid Date, not in future) * - notes (if provided, must be string with max length) * - location (if provided, must have valid lat/lng ranges) * - device (if provided, must be object) * * @param data - Check-in data object * @param config - Validation configuration * @throws ValidationError if any field is invalid */ declare function validateCheckInData(data: { method?: string; timestamp?: Date; notes?: string; location?: { lat?: number; lng?: number; accuracy?: number; }; device?: { type?: string; platform?: string; appVersion?: string; }; metadata?: Record; } | undefined, config?: CheckInDataValidationConfig): void; /** * Validate days parameter for analytics queries * * @param days - Number of days * @param max - Maximum allowed value (default: 365) * @throws ValidationError if invalid */ declare function validateDaysParameter(days?: number, max?: number): void; /** * Validate limit parameter for queries * * @param limit - Query limit * @param max - Maximum allowed value (default: 1000) * @throws ValidationError if invalid */ declare function validateLimitParameter(limit?: number, max?: number): void; declare const _default$4: { validateCheckInEligibility: typeof validateCheckInEligibility; validateCheckInTiming: typeof validateCheckInTiming; validateTargetModel: typeof validateTargetModel; validateCheckInMethod: typeof validateCheckInMethod; validateOrganizationId: typeof validateOrganizationId; validatePagination: typeof validatePagination; validateDateRange: typeof validateDateRange; validateYear: typeof validateYear; validateMonth: typeof validateMonth; assertValidMember: typeof assertValidMember; assertValidCheckInTiming: typeof assertValidCheckInTiming; validateCheckInData: typeof validateCheckInData; validateDaysParameter: typeof validateDaysParameter; validateLimitParameter: typeof validateLimitParameter; }; type validators_CheckInDataValidationConfig = CheckInDataValidationConfig; type validators_TargetModelValidationConfig = TargetModelValidationConfig; declare const validators_assertValidCheckInTiming: typeof assertValidCheckInTiming; declare const validators_assertValidMember: typeof assertValidMember; declare const validators_validateCheckInData: typeof validateCheckInData; declare const validators_validateCheckInEligibility: typeof validateCheckInEligibility; declare const validators_validateCheckInMethod: typeof validateCheckInMethod; declare const validators_validateCheckInTiming: typeof validateCheckInTiming; declare const validators_validateDateRange: typeof validateDateRange; declare const validators_validateDaysParameter: typeof validateDaysParameter; declare const validators_validateLimitParameter: typeof validateLimitParameter; declare const validators_validateMonth: typeof validateMonth; declare const validators_validateOrganizationId: typeof validateOrganizationId; declare const validators_validatePagination: typeof validatePagination; declare const validators_validateTargetModel: typeof validateTargetModel; declare const validators_validateYear: typeof validateYear; declare namespace validators { export { type validators_CheckInDataValidationConfig as CheckInDataValidationConfig, type validators_TargetModelValidationConfig as TargetModelValidationConfig, validators_assertValidCheckInTiming as assertValidCheckInTiming, validators_assertValidMember as assertValidMember, _default$4 as default, validators_validateCheckInData as validateCheckInData, validators_validateCheckInEligibility as validateCheckInEligibility, validators_validateCheckInMethod as validateCheckInMethod, validators_validateCheckInTiming as validateCheckInTiming, validators_validateDateRange as validateDateRange, validators_validateDaysParameter as validateDaysParameter, validators_validateLimitParameter as validateLimitParameter, validators_validateMonth as validateMonth, validators_validateOrganizationId as validateOrganizationId, validators_validatePagination as validatePagination, validators_validateTargetModel as validateTargetModel, validators_validateYear as validateYear }; } /** * Schedule Utilities * * Pure functions for working with employee schedules * Functional, testable, zero side effects * * @module @classytic/clockin/utils/schedule */ /** * Parse time string to decimal hours * * @example * ```typescript * parseTime("09:30") // 9.5 * parseTime("14:00") // 14 * ``` * * @param timeString - Time in "HH:MM" format * @returns Decimal hours (0-24) or null if invalid */ declare function parseTime(timeString: string | undefined | null): number | null; /** * Calculate standard daily hours from work schedule * Supports multiple schedule formats with graceful fallbacks * * @example * ```typescript * calculateStandardHours({ hoursPerDay: 8 }) // 8 * calculateStandardHours({ hoursPerWeek: 40, workingDays: [1,2,3,4,5] }) // 8 * calculateStandardHours({ shiftStart: "09:00", shiftEnd: "17:00" }) // 8 * calculateStandardHours(null) // 8 (default) * ``` * * @param workSchedule - Employee's work schedule * @returns Standard daily hours (default: 8) */ declare function calculateStandardHours(workSchedule: WorkSchedule | undefined | null): number; /** * Check if a given time is within the scheduled shift * * @example * ```typescript * isWithinShift(new Date("2025-11-08T09:30:00"), { shiftStart: "09:00", shiftEnd: "17:00" }) * // { within: true, earlyBy: 0, lateBy: 0 } * ``` * * @param timestamp - Check-in timestamp * @param workSchedule - Employee's work schedule * @param toleranceHours - Grace period in hours (default: 1) * @returns Check result */ declare function isWithinShift(timestamp: Date, workSchedule: WorkSchedule | undefined | null, toleranceHours?: number): ScheduleCheckResult; /** * Check if a given day is a scheduled working day * * @example * ```typescript * isWorkingDay(new Date("2025-11-10"), { workingDays: [1,2,3,4,5] }) // Monday * // { isWorking: true, dayName: 'Monday' } * ``` * * @param timestamp - Date to check * @param workSchedule - Employee's work schedule * @returns Working day result */ declare function isWorkingDay(timestamp: Date, workSchedule: WorkSchedule | undefined | null): WorkingDayResult; /** * Calculate attendance classification thresholds based on schedule * * @example * ```typescript * calculateThresholds({ hoursPerDay: 4 }) * // { overtime: 4.4, fullDay: 3, halfDay: 1.6, unpaid: 1.6 } * ``` * * @param workSchedule - Employee's work schedule * @returns Thresholds in hours */ declare function calculateThresholds(workSchedule: WorkSchedule | undefined | null): ScheduleThresholds; /** * Calculate expected checkout time based on schedule * * @param checkInTime - Check-in timestamp * @param workSchedule - Employee's work schedule * @param defaultHours - Default hours if no schedule * @param maxSession - Maximum session hours * @returns Expected checkout time */ declare function calculateExpectedCheckout(checkInTime: Date, workSchedule: WorkSchedule | undefined | null, defaultHours?: number, maxSession?: number): Date; /** * Format work schedule for display * * @example * ```typescript * formatSchedule({ hoursPerDay: 8, shiftStart: "09:00", shiftEnd: "17:00", workingDays: [1,2,3,4,5] }) * // "8 hours/day, Mon, Tue, Wed, Thu, Fri, 09:00-17:00" * ``` * * @param workSchedule - Employee's work schedule * @returns Human-readable schedule */ declare function formatSchedule(workSchedule: WorkSchedule | undefined | null): string; declare const _default$3: { parseTime: typeof parseTime; calculateStandardHours: typeof calculateStandardHours; isWithinShift: typeof isWithinShift; isWorkingDay: typeof isWorkingDay; calculateThresholds: typeof calculateThresholds; calculateExpectedCheckout: typeof calculateExpectedCheckout; formatSchedule: typeof formatSchedule; }; declare const schedule_calculateExpectedCheckout: typeof calculateExpectedCheckout; declare const schedule_calculateStandardHours: typeof calculateStandardHours; declare const schedule_calculateThresholds: typeof calculateThresholds; declare const schedule_formatSchedule: typeof formatSchedule; declare const schedule_isWithinShift: typeof isWithinShift; declare const schedule_isWorkingDay: typeof isWorkingDay; declare const schedule_parseTime: typeof parseTime; declare namespace schedule { export { schedule_calculateExpectedCheckout as calculateExpectedCheckout, schedule_calculateStandardHours as calculateStandardHours, schedule_calculateThresholds as calculateThresholds, _default$3 as default, schedule_formatSchedule as formatSchedule, schedule_isWithinShift as isWithinShift, schedule_isWorkingDay as isWorkingDay, schedule_parseTime as parseTime }; } /** * Check-In Utilities * * Pure functions for check-in logic - easily testable * * @module @classytic/clockin/utils/check-in */ /** * Check if check-in is active (not checked out) */ declare function isActiveCheckIn(checkIn: Pick): boolean; /** * Check if check-in is expired (past expected checkout) */ declare function isExpiredCheckIn(checkIn: Pick, now?: Date): boolean; /** * Find active (not checked out) session in check-ins array */ declare function findActiveSession>(checkIns: T[]): T | undefined; /** * Filter to active check-ins only */ declare function filterActiveCheckIns>(checkIns: T[]): T[]; /** * Count active check-ins */ declare function countActiveCheckIns(checkIns: Pick[]): number; /** * Calculate duration in minutes between two timestamps */ declare function calculateDuration(startTime: Date | string, endTime?: Date | string): number; /** * Get current period (year and month) */ declare function getCurrentPeriod(date?: Date): { year: number; month: number; }; /** * Group items by target model */ declare function groupByTargetModel(items: T[]): Record; /** * Calculate total count from grouped data */ declare function calculateTotalCount(groupedData: Record): number; /** * Get unique days from check-ins */ declare function getUniqueDays(checkIns: Pick[]): Set; /** * Count unique days visited */ declare function countUniqueDays(checkIns: Pick[]): number; /** * Get most common time slot from check-ins */ declare function getMostCommonTimeSlot(distribution: Record): string; /** * Group check-ins by unique dates */ declare function groupCheckInsByDate>(checkIns: T[]): Map; declare const _default$2: { isActiveCheckIn: typeof isActiveCheckIn; isExpiredCheckIn: typeof isExpiredCheckIn; findActiveSession: typeof findActiveSession; filterActiveCheckIns: typeof filterActiveCheckIns; countActiveCheckIns: typeof countActiveCheckIns; calculateDuration: typeof calculateDuration; getCurrentPeriod: typeof getCurrentPeriod; groupByTargetModel: typeof groupByTargetModel; calculateTotalCount: typeof calculateTotalCount; getUniqueDays: typeof getUniqueDays; countUniqueDays: typeof countUniqueDays; getMostCommonTimeSlot: typeof getMostCommonTimeSlot; groupCheckInsByDate: typeof groupCheckInsByDate; }; declare const checkIn_calculateDuration: typeof calculateDuration; declare const checkIn_calculateTotalCount: typeof calculateTotalCount; declare const checkIn_countActiveCheckIns: typeof countActiveCheckIns; declare const checkIn_countUniqueDays: typeof countUniqueDays; declare const checkIn_filterActiveCheckIns: typeof filterActiveCheckIns; declare const checkIn_findActiveSession: typeof findActiveSession; declare const checkIn_getCurrentPeriod: typeof getCurrentPeriod; declare const checkIn_getMostCommonTimeSlot: typeof getMostCommonTimeSlot; declare const checkIn_getUniqueDays: typeof getUniqueDays; declare const checkIn_groupByTargetModel: typeof groupByTargetModel; declare const checkIn_groupCheckInsByDate: typeof groupCheckInsByDate; declare const checkIn_isActiveCheckIn: typeof isActiveCheckIn; declare const checkIn_isExpiredCheckIn: typeof isExpiredCheckIn; declare namespace checkIn { export { checkIn_calculateDuration as calculateDuration, checkIn_calculateTotalCount as calculateTotalCount, checkIn_countActiveCheckIns as countActiveCheckIns, checkIn_countUniqueDays as countUniqueDays, _default$2 as default, checkIn_filterActiveCheckIns as filterActiveCheckIns, checkIn_findActiveSession as findActiveSession, checkIn_getCurrentPeriod as getCurrentPeriod, checkIn_getMostCommonTimeSlot as getMostCommonTimeSlot, checkIn_getUniqueDays as getUniqueDays, checkIn_groupByTargetModel as groupByTargetModel, checkIn_groupCheckInsByDate as groupCheckInsByDate, checkIn_isActiveCheckIn as isActiveCheckIn, checkIn_isExpiredCheckIn as isExpiredCheckIn }; } /** * Query Builders * * MongoDB query construction utilities * * @module @classytic/clockin/utils/query-builders */ /** * Convert string to ObjectId */ declare function toObjectId(id: ObjectIdLike): ObjectId; /** * Safe ObjectId conversion (returns null if invalid) */ declare function safeToObjectId(id: unknown): ObjectId | null; /** * Build attendance match query */ declare function buildAttendanceMatch(params: { organizationId: ObjectIdLike; targetModel?: AttendanceTargetModel | null; targetId?: ObjectIdLike | null; year?: number; month?: number; }): Record; /** * Build member match query */ declare function buildMemberMatch(params: { organizationId: ObjectIdLike; status?: string | string[]; additionalFilters?: Record; }): Record; /** * Build occupancy pipeline */ declare function buildOccupancyPipeline(match: Record): unknown[]; /** * Build stats aggregation pipeline */ declare function buildStatsAggregation(params: { organizationId: ObjectIdLike; startDate?: Date; endDate?: Date; }): unknown[]; /** * Build current session query */ declare function buildCurrentSessionQuery(params: { organizationId: ObjectIdLike; isActive?: boolean; }): Record; /** * Build date range filter */ declare function buildDateRangeFilter(startDate?: Date, endDate?: Date, field?: string): Record | null; /** * Build period filter for attendance queries */ declare function buildPeriodFilter(startDate: Date, endDate: Date): { years: number[]; months: number[]; }; declare const _default$1: { toObjectId: typeof toObjectId; safeToObjectId: typeof safeToObjectId; buildAttendanceMatch: typeof buildAttendanceMatch; buildMemberMatch: typeof buildMemberMatch; buildOccupancyPipeline: typeof buildOccupancyPipeline; buildStatsAggregation: typeof buildStatsAggregation; buildCurrentSessionQuery: typeof buildCurrentSessionQuery; buildDateRangeFilter: typeof buildDateRangeFilter; buildPeriodFilter: typeof buildPeriodFilter; }; declare const queryBuilders_buildAttendanceMatch: typeof buildAttendanceMatch; declare const queryBuilders_buildCurrentSessionQuery: typeof buildCurrentSessionQuery; declare const queryBuilders_buildDateRangeFilter: typeof buildDateRangeFilter; declare const queryBuilders_buildMemberMatch: typeof buildMemberMatch; declare const queryBuilders_buildOccupancyPipeline: typeof buildOccupancyPipeline; declare const queryBuilders_buildPeriodFilter: typeof buildPeriodFilter; declare const queryBuilders_buildStatsAggregation: typeof buildStatsAggregation; declare const queryBuilders_safeToObjectId: typeof safeToObjectId; declare const queryBuilders_toObjectId: typeof toObjectId; declare namespace queryBuilders { export { queryBuilders_buildAttendanceMatch as buildAttendanceMatch, queryBuilders_buildCurrentSessionQuery as buildCurrentSessionQuery, queryBuilders_buildDateRangeFilter as buildDateRangeFilter, queryBuilders_buildMemberMatch as buildMemberMatch, queryBuilders_buildOccupancyPipeline as buildOccupancyPipeline, queryBuilders_buildPeriodFilter as buildPeriodFilter, queryBuilders_buildStatsAggregation as buildStatsAggregation, _default$1 as default, queryBuilders_safeToObjectId as safeToObjectId, queryBuilders_toObjectId as toObjectId }; } /** * Attendance Type Detection * * Smart detection of attendance type based on duration and schedule * * @module @classytic/clockin/utils/detection */ /** * Detect attendance type based on duration * * @param durationHours - Session duration in hours * @param targetModel - Target model name * @param member - Member document (for schedule-aware detection) * @param config - Target model configuration * @returns Detected attendance type */ declare function detectAttendanceType(durationHours: number, targetModel: string, member: { workSchedule?: WorkSchedule; } | null, config: TargetModelConfig): AttendanceType; /** * Validate check-in against schedule * * @param params - Validation parameters * @returns Validation result with warnings */ declare function validateSchedule(params: { checkInTime: Date; targetModel: string; member: { workSchedule?: WorkSchedule; } | null; config: TargetModelConfig; }): { valid: boolean; warnings: string[]; }; declare const _default: { detectAttendanceType: typeof detectAttendanceType; validateSchedule: typeof validateSchedule; }; declare const detection_detectAttendanceType: typeof detectAttendanceType; declare const detection_validateSchedule: typeof validateSchedule; declare namespace detection { export { _default as default, detection_detectAttendanceType as detectAttendanceType, detection_validateSchedule as validateSchedule }; } export { Logger, assertValidCheckInTiming, assertValidMember, buildAttendanceMatch, buildCurrentSessionQuery, buildDateRangeFilter, buildMemberMatch, buildOccupancyPipeline, buildPeriodFilter, buildStatsAggregation, calculateDaysSinceLastVisit, calculateDuration, calculateEngagementLevel, calculateExpectedCheckout, calculateLoyaltyScore, calculateMonthsSince, calculateStandardHours, calculateStreak, calculateThresholds, calculateTotalCount, checkIn as checkInUtils, countActiveCheckIns, countUniqueDays, createChildLogger, daysUntilStreakBreaks, detectAttendanceType, detection as detectionUtils, engagement as engagementUtils, filterActiveCheckIns, findActiveSession, formatSchedule, getCurrentPeriod, getEngagementColor, getEngagementDisplayText, getEngagementSeverity, getLogger, getMostCommonTimeSlot, getNextStreakMilestone, getStreakStatus, getUniqueDays, groupByTargetModel, groupCheckInsByDate, hasEngagementChanged, isActiveCheckIn, isExpiredCheckIn, isStreakMilestone, isWithinShift, isWorkingDay, parseTime, queryBuilders, resetLogger, safeToObjectId, schedule as scheduleUtils, setLogger, streak as streakUtils, toObjectId, validateCheckInEligibility, validateCheckInMethod, validateCheckInTiming, validateDateRange, validateMonth, validateOrganizationId, validatePagination, validateSchedule, validateTargetModel, validateYear, validators as validatorUtils };