
    =j^                     0    d dl mZ d dlmZ  G d d      Zy)    )OtpRepository)OtpModelc                   :    e Zd Zd ZdedefdZdefdZdefdZy)	
OtpServicec                 "    t               | _        y N)r   repo)selfs    7F:\Balli\ai-photo-editor\app\modules\otp\otp_service.py__init__zOtpService.__init__   s    !O	    phoneotpCodec                 z   K   t        ||      }| j                  j                  |       d {   }|||dS 7 
w)N)r   r   )otp_idr   r   )r   r	   add_otp)r
   r   r   otpr   s        r   r   zOtpService.add_otp
   sI     

 yy((-- 
 	
 .s   ,;9;c                 T   K   | j                   j                  |       d {   S 7 wr   )r	   get_active_otp_by_phone)r
   r   s     r   r   z"OtpService.get_active_otp_by_phone   s!     YY66u====s   (&(_idc                 `   K   | j                   j                  |       d {   }dd|dS 7 
w)NTzOTP expired successfully)successmessageupdated)r	   
expire_otp)r
   r   results      r   r   zOtpService.expire_otp   s5     yy++C00- 	 1s   .,.N)__name__
__module____qualname__r   strr   r   r    r   r   r   r      s2    $
3 
 
>3 ># r   r   N)app.modules.otp.otp_repositoryr   app.modules.otp.otp_modelr   r   r!   r   r   <module>r$      s    8 . r   