import { VerificationCodeEntity } from '../entities/verification-code.entity';

/**
 * Verification Code Repository Interface
 * Defines the contract for verification code data persistence
 */
export interface IVerificationCodeRepository {
  /**
   * Save a new verification code
   */
  save(code: VerificationCodeEntity): Promise<VerificationCodeEntity>;

  /**
   * Find valid verification code by phone and code
   */
  findValidCode(phone: string, code: string): Promise<VerificationCodeEntity | null>;

  /**
   * Count recent codes sent to a phone number
   */
  countRecentByPhone(phone: string, hoursBack: number): Promise<number>;

  /**
   * Mark a verification code as used
   */
  markAsUsed(id: string): Promise<void>;
}

/**
 * Dependency injection token for IVerificationCodeRepository
 */
export const VERIFICATION_CODE_REPOSITORY = Symbol('IVerificationCodeRepository');
