CREATE TABLE `users` (
  `id` int UNSIGNED NOT NULL,
  `merchant_id` int UNSIGNED NOT NULL,
  `user_merchant_id` int DEFAULT NULL,
  `taxi_company_id` int UNSIGNED DEFAULT NULL,
  `country_id` int UNSIGNED DEFAULT NULL,
  `social_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country_area_id` int UNSIGNED DEFAULT NULL,
  `unique_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_type` int NOT NULL DEFAULT '2',
  `corporate_id` int UNSIGNED DEFAULT NULL,
  `corporate_email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `first_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `UserPhone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `whatsapp_notifications` tinyint(1) NOT NULL DEFAULT '1',
  `whatsapp_phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ride_otp` int DEFAULT NULL,
  `total_trips` int DEFAULT NULL,
  `wallet_balance` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '0',
  `UserSignupType` int NOT NULL DEFAULT '1',
  `UserSignupFrom` int NOT NULL DEFAULT '1' COMMENT '1 : application, 2: admin, 3: web,4:whatsapp',
  `UserProfileImage` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '',
  `ReferralCode` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `rating` decimal(10,1) DEFAULT '5.0',
  `manual_user` int NOT NULL DEFAULT '0',
  `EmailVerified` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `PhoneVerified` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `UserStatus` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1',
  `outstanding_amount` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `outstanding_booking_id` int UNSIGNED DEFAULT NULL,
  `user_gender` int DEFAULT NULL,
  `smoker_type` int DEFAULT NULL,
  `allow_other_smoker` int DEFAULT '2',
  `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_delete` int DEFAULT NULL,
  `my_services` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `detail_status` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `identity_verification_status` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `average_rating` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `signup_completed` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `signup_status` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_document` int DEFAULT NULL,
  `approved_document` int DEFAULT NULL,
  `term_status` int DEFAULT '0',
  `type` int DEFAULT NULL,
  `UserName` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_cpf_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `login_type` tinyint DEFAULT NULL COMMENT '1 : demo, 2  means normal',
  `language` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'fr',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `reward_points` double DEFAULT NULL,
  `usable_reward_points` double DEFAULT NULL,
  `use_reward_trip_count` int UNSIGNED NOT NULL DEFAULT '0',
  `first_reward_pending` tinyint UNSIGNED DEFAULT NULL,
  `network_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `designation_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `login_via` int NOT NULL DEFAULT '1' COMMENT '1: Personal Account, 2 :Corporate Account',
  `online_offline` int NOT NULL DEFAULT '2',
  `login_logout` int NOT NULL DEFAULT '2',
  `access_token_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device` tinyint DEFAULT NULL COMMENT '1:Android, 2:iOS ',
  `fcm_device_token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `player_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_method_id` int UNSIGNED NOT NULL DEFAULT '1',
  `last_trip_date` date DEFAULT NULL,
  `consecutive_days_count` int NOT NULL DEFAULT '0',
  `first_trip_today` tinyint(1) NOT NULL DEFAULT '1',
  `current_latitude` decimal(10,8) DEFAULT NULL,
  `current_longitude` decimal(11,8) DEFAULT NULL,
  `current_action` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_action_at` timestamp NULL DEFAULT NULL,
  `action_data` json DEFAULT NULL,
  `last_location_update` timestamp NULL DEFAULT NULL,
  `referral_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `whatsapp_notifications_enabled` tinyint(1) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
