import { ModelDefinition } from '@nestjs/mongoose'; import { Document } from 'mongoose'; /** * Lock * * Represents a distributed lock document stored in MongoDB. * * Each lock is uniquely identified by a `lockKey` and claimed by a specific * service instance via `serviceId`. Locks have an expiration date `expiresAt` * to automatically release stale locks and avoid deadlocks. */ export declare class Lock extends Document { /** * Unique identifier for the lock resource. * * Ensures that only one lock exists per key. */ lockKey: string; /** * Identifier of the service instance that owns this lock. * * Used to verify ownership before releasing a lock. */ serviceId: string; /** * Expiration date and time of the lock. * * MongoDB TTL index configured with `expires: 0` automatically removes the lock document * when the `expiresAt` time is reached, preventing stale locks from persisting. */ expiresAt: Date; } /** * Model definition for the Lock schema. * * Used by Mongoose to create the model and enable typing. */ export declare const LockDefinition: ModelDefinition;