-- name: CreateUserOtp :one
INSERT INTO userotp (
    otp_code,
    otp_code_expiry_time,
    contact
 ) VALUES (
    $1, 
    $2,
    $3
 ) RETURNING *;

-- name: UserOtpStatus :one
UPDATE userotp
    SET 
     status = $4
WHERE otp_code= $3 
AND   contact = $2
AND   id = $1
RETURNING *;


-- name: UserOtpVerification :one
SELECT * FROM userotp
WHERE otp_code= $2 
AND   contact = $1;
