const {
  getUserDashboardAnalytics,
  getUserInfo,
  updateUserInfo,
  getUserAddresses,
  addUserAddress,
  updateUserAddress,
  toggle2FA,
  initiate2FA,
  verify2FA,
  validateAccountNumber,
  addAccountDetails,
} = require('../controllers/user');
const { authenticate } = require('../middleware/auth');

const router = require('express').Router();

router.get('/dashboard-analytics', authenticate, getUserDashboardAnalytics);
router.get('/', authenticate, getUserInfo);
router.patch('/', authenticate, updateUserInfo);
router.get('/addresses', authenticate, getUserAddresses);
router.post('/addresses', authenticate, addUserAddress);
router.patch('/addresses/:addressId', authenticate, updateUserAddress);
router.get('/validate-account-number', authenticate, validateAccountNumber)
router.post('/add-account-details', authenticate, addAccountDetails)
router.post('/2fa/toggle', authenticate, toggle2FA);
router.post('/2fa/initiate', authenticate, initiate2FA);
router.post('/2fa/verify', authenticate, verify2FA);

module.exports = router;
