public response getOTP(loginModels req, IConfiguration _config)
        {
            response _response = response.GetInstance();
            string   token     = string.Empty;

            try
            {
                Random     _rdm        = new Random();
                int        num         = _rdm.Next(1000, 9999);
                otpDetails _otpDetails = new otpDetails();
                _otpDetails.mobileNumber = req.mobileNumber;
                _otpDetails.otp          = num;


                //send otp using sms
                token = _config.GetValue <string>("token:value");
                if (!sendSMS(req.mobileNumber, num, token))
                {
                    _response.apiStatuscode = 500;
                    _response.error         = $"Error while Sending SMS OTP";
                    _response.success       = false;
                    _response.data          = "";
                    _response.request       = req;
                    _response.appErrorcode  = 1003;
                    return(_response);
                }
                otpDetailsDataBaseSettings _otpDetailsDataBaseSettings = new otpDetailsDataBaseSettings();
                _otpDetailsDataBaseSettings = _otpDetailsDataBaseSettings.setprops(_config);
                otpService _otpService     = new otpService(_otpDetailsDataBaseSettings);
                otpDetails _otpDetailsdata = _otpService.Get(req.mobileNumber);

                if (_otpDetailsdata == null)
                {
                    _otpDetails = _otpService.Create(_otpDetails);
                }
                else
                {
                    _otpDetails._id = _otpDetailsdata._id;
                    _otpService.Update(_otpDetailsdata._id, _otpDetails);
                }

                _response.data          = $"OTP sent on Mobile:{_otpDetails.mobileNumber}";
                _response.apiStatuscode = 200;
                _response.appErrorcode  = 0;
                _response.success       = true;
                _response.error         = "";
                _response.request       = req;
            }
            catch (Exception ex)
            {
                _response.error = ex.Message;
            }
            return(_response);
        }
        public response validateoperations(validatOTP req, IConfiguration _config)
        {
            response _response = response.GetInstance();

            try
            {
                otpDetailsDataBaseSettings _otpDetailsDataBaseSettings = new otpDetailsDataBaseSettings();
                _otpDetailsDataBaseSettings = _otpDetailsDataBaseSettings.setprops(_config);
                otpService _otpService = new otpService(_otpDetailsDataBaseSettings);
                otpDetails _otpDetails = _otpService.Get(req.mobileNumber);
                if (_otpDetails.otp == req.OTP && _otpDetails.mobileNumber == req.mobileNumber)
                {
                    _response.apiStatuscode = 200;
                    _response.error         = "";
                    _response.success       = true;
                    _response.data          = "Valid OTP";
                    _response.request       = req;
                    _response.appErrorcode  = 0;
                }
                else
                {
                    _response.apiStatuscode = 404;
                    _response.error         = "Inavlid OTP";
                    _response.success       = true;
                    _response.data          = "";
                    _response.request       = req;
                    _response.appErrorcode  = 0;
                }
            }
            catch (Exception ex)
            {
                _response.error = ex.Message;
            }

            return(_response);
        }