async function list(req, res) {
  const { models, user, query } = req;
  const { queryId, includeStatements } = query;

  let batches;
  if (queryId) {
    const cleanedQueryId = queryId === 'null' ? null : queryId;
    let cleanedIncludeStatements = false;
    if (includeStatements) {
      cleanedIncludeStatements =
        includeStatements.toString().toLowerCase().trim() === 'true';
    }

    batches = await models.batches.findAllForUserQuery(
      user,
      cleanedQueryId,
      cleanedIncludeStatements
    );
  } else {
    batches = await models.batches.findAllForUser(user);
  }

  batches.forEach((batch) => {
    batch.startTimeCalendar = moment(batch.startTime).calendar();
    batch.stopTimeCalendar = moment(batch.stopTime).calendar();
    batch.createdAtCalendar = moment(batch.createdAt).calendar();
  });

  return res.utils.data(batches);
}
List batches.
Restricted to batches for the currently logged in user
@param {Req} req
@param {Res} res