<commit_before>import db from '../../models';
import { Router } from 'express';
import { Affiliation, Household, User, Me, Reports, Slips, Cmpd  } from './controllers'
import auth from '../lib/auth'

const validators = require('./validators/household');

const router = Router();

// TODO: require more than ensureLoggedIn for these tasks

// Households
router.get('/households', auth.ensureLoggedIn, Household.list);
router.get('/households/:id', auth.ensureLoggedIn, Household.getHousehold);
router.put('/households/:id', auth.ensureLoggedIn, validators, Household.updateHousehold);
router.post('/households', auth.ensureLoggedIn, validators, Household.createHousehold);
router.post('/households/submit', auth.ensureLoggedIn, Household.submitNomination);
router.post('/households/:id/upload', auth.ensureLoggedIn, Household.createAttachments);
router.post('/households/:id/feedback', auth.ensureLoggedIn, Household.submitFeedback);
router.post('/households/:id/attachments', auth.ensureLoggedIn, Household.createAttachments);
router.get('/households/:id/attachments', auth.ensureLoggedIn, Household.getAttachments);
router.delete('/households/:id', auth.ensureAdmin, Household.removeHousehold);

// Users
router.get('/me', auth.ensureLoggedIn, Me.getMe).use(auth.ensureLoggedIn);
router.get('/me/limit/status', auth.ensureLoggedIn, Me.getNominationsStatus);
router.get('/users/pending', auth.ensureAdmin, User.listPendingUsers);
router.get('/users', auth.ensureAdmin, User.list);
router.post('/users', auth.ensureAdmin, User.createUser);
router.post('/users/:id/approve', auth.ensureAdmin, User.approveUser);
router.post('/users/:id/decline', auth.ensureAdmin, User.declineUser);
router.put('/users/:id').use(auth.ensureAdmin, User.updateUser);
router.get('/users/:id', auth.ensureLoggedIn, User.getUser);

// Affiliations
router.get('/affiliations', Affiliation.list)
router.get('/affiliations/:id', auth.ensureLoggedIn, Affiliation.getAffiliation)

// Reports
router.post('/report/all', auth.ensureAdmin, Reports.export_data_excel);
router.post('/report/link', auth.ensureAdmin, Reports.link_report);
router.post('/report/bikes', auth.ensureAdmin, Reports.bike_report);
router.post('/report/division', auth.ensureAdmin, Reports.division_report)

// CMPD Address Info
router.get('/cmpd/address_info', auth.ensureLoggedIn, Cmpd.getAddressInfo);

// Slips - Packing slip handles both the packing slips AND bicycles
router.get('/slips/packing', auth.ensureAdmin, Slips.packing);

router.get('/test', async function (req, res) {
  const households = await db['household'].findAll({
    where: { approved: true },
    include: [
      { model: db['household_address'], as: 'address' },
      { model: db['household_phone'], as: 'phones' }
    ]
  });

  console.error('TODO');
  return (res.json(households));
})

export default router<commit_msg>Comment out unfinished routes<commit_after>import db from '../../models';
import { Router } from 'express';
import { Affiliation, Household, User, Me, Reports, Slips, Cmpd  } from './controllers'
import auth from '../lib/auth'

const validators = require('./validators/household');

const router = Router();

// TODO: require more than ensureLoggedIn for these tasks
// TODO: Implement commented routes

// Households
router.get('/households', auth.ensureLoggedIn, Household.list);
// router.get('/households/:id', auth.ensureLoggedIn, Household.getHousehold);
// router.put('/households/:id', auth.ensureLoggedIn, validators, Household.updateHousehold);
// router.post('/households', auth.ensureLoggedIn, validators, Household.createHousehold);
// router.post('/households/submit', auth.ensureLoggedIn, Household.submitNomination);
// router.post('/households/:id/upload', auth.ensureLoggedIn, Household.createAttachments);
// router.post('/households/:id/feedback', auth.ensureLoggedIn, Household.submitFeedback);
// router.post('/households/:id/attachments', auth.ensureLoggedIn, Household.createAttachments);
// router.get('/households/:id/attachments', auth.ensureLoggedIn, Household.getAttachments);
// router.delete('/households/:id', auth.ensureAdmin, Household.removeHousehold);

// Users
// router.get('/me', auth.ensureLoggedIn, Me.getMe).use(auth.ensureLoggedIn);
// router.get('/me/limit/status', auth.ensureLoggedIn, Me.getNominationsStatus);
// router.get('/users/pending', auth.ensureAdmin, User.listPendingUsers);
// router.get('/users', auth.ensureAdmin, User.list);
// router.post('/users', auth.ensureAdmin, User.createUser);
// router.post('/users/:id/approve', auth.ensureAdmin, User.approveUser);
// router.post('/users/:id/decline', auth.ensureAdmin, User.declineUser);
// router.put('/users/:id').use(auth.ensureAdmin, User.updateUser);
// router.get('/users/:id', auth.ensureLoggedIn, User.getUser);

// Affiliations
router.get('/affiliations', Affiliation.list)
router.get('/affiliations/:id', Affiliation.getAffiliation)

// Reports
// router.post('/report/all', auth.ensureAdmin, Reports.export_data_excel);
// router.post('/report/link', auth.ensureAdmin, Reports.link_report);
// router.post('/report/bikes', auth.ensureAdmin, Reports.bike_report);
// router.post('/report/division', auth.ensureAdmin, Reports.division_report)

// CMPD Address Info
// router.get('/cmpd/address_info', auth.ensureLoggedIn, Cmpd.getAddressInfo);

// Slips - Packing slip handles both the packing slips AND bicycles
// router.get('/slips/packing', auth.ensureAdmin, Slips.packing);

// router.get('/test', async function (req, res) {
//   const households = await db['household'].findAll({
//     where: { approved: true },
//     include: [
//       { model: db['household_address'], as: 'address' },
//       { model: db['household_phone'], as: 'phones' }
//     ]
//   });

//   console.error('TODO');
//   return (res.json(households));
// })

export default router
{'fraction_non_alphanumeric': 0.17353244078269825, 'fraction_numerical': 0.0, 'mean_word_length': 5.31995661605206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3202498', 'n_tokens_mistral': 1820, 'n_tokens_neox': 1816, 'n_words': 327}