import { Device, UserRole } from "vr-models"; import { Transaction } from "sequelize"; import { DeviceResetOptions, DeviceResetResult, StockChangeResult } from "./types"; export declare const stockUtil: { /** * Increment stock when devices are added/created */ incrementStock(productId: string, quantity?: number, options?: { transaction?: Transaction; reason?: string; actorId?: string; actorType: UserRole; }): Promise; /** * Decrement stock when devices are removed/deleted/assigned */ decrementStock(productId: string, quantity?: number, options?: { transaction?: Transaction; reason?: string; actorId?: string; allowNegative?: boolean; actorType: UserRole; }): Promise; /** * Set stock to specific value */ setStock(productId: string, newStock: number, options?: { transaction?: Transaction; reason?: string; actorId?: string; actorType: UserRole; }): Promise; /** * Validate if product has enough stock */ hasEnoughStock(productId: string, quantity?: number, transaction?: Transaction): Promise; /** * Get current stock level */ getStockLevel(productId: string, transaction?: Transaction): Promise; /** * Bulk update stock for multiple products */ bulkUpdateStock(updates: Array<{ productId: string; change: number; reason?: string; }>, actorType: UserRole, options?: { transaction?: Transaction; actorId?: string; }): Promise>; /** * Sync stock based on actual device count */ syncStockWithDeviceCount(productId: string, actorType: UserRole, options?: { transaction?: Transaction; actorId?: string; }): Promise; /** * Generate serial number from pair ID and dedication * Format: VIBERIDE-{RIDER|PASSENGER}-{pairId} */ generateSerialNumber(pairId: string, dedication: string): string; /** * Validate pair ID format * No letter 'O' to avoid confusion with 0 */ validatePairIdFormat(pairId: string): boolean; /** * Get devices by pair IDs (returns both RIDER and PASSENGER) */ getDevicesByPairIds(pairIds: string[], transaction?: any): Promise; /** * Get devices by serial numbers */ getDevicesBySerialNumbers(serialNumbers: string[], transaction?: any): Promise; /** * Validate that exactly one identifier type is provided */ validateIdentifiers(pairIds?: string[], serialNumbers?: string[]): { valid: boolean; error?: string | undefined; devices?: Device[] | undefined; }; /** * Check if pair exists and is not soft deleted */ checkPairExists(pairId: string, transaction?: any): Promise<{ exists: boolean; devices?: Device[]; missing?: string[]; }>; /** * Check if pair IDs exist and are not soft deleted (for bulk operations) */ checkMultiplePairsExist(pairIds: string[], transaction?: any): Promise<{ valid: boolean; existingPairs: string[]; missingPairs: string[]; incompletePairs: string[]; }>; /** * Disable a device pair (both RIDER and PASSENGER) * - Sets status to "disabled" * - Logs the action */ disableDevicePair(pairId: string, transaction?: any): Promise<{ success: boolean; message: string; devices: Device[]; }>; /** * Enable a device pair back (both RIDER and PASSENGER) * - Sets status to "locked" * - Restores dedicatedUser (RIDER/PASSENGER) from serial number * - Logs the action */ enableDevicePair(pairId: string, transaction?: any): Promise<{ success: boolean; message: string; devices: Device[]; }>; /** * Reset device pairs status based on conditions * - Locks/unlocks both RIDER and PASSENGER devices in each pair together * - Flexible conditions and updates * - Uses batch processing for large datasets */ resetAllDevicesStatus(options?: DeviceResetOptions): Promise; };