import { SmsService } from "../../utils/sms.service"

const smsService = new SmsService()

export const sendOtpViaSms = async (
  toPhoneNumber: string,
  otp: string,
): Promise<boolean> => {
  try {
    await smsService.sendSms(toPhoneNumber, `Your OTP is: ${otp}`)
    return true
  } catch (error) {
    console.error("Error sending OTP via SMS:", error)
    throw new Error("Failed to send OTP via SMS")
  }
}
