function mapMeRequestToUserId(req) {
  // authMiddleware -> req.user.userId
  return req.user.userId;
}

function mapMeResultToResponse(user) {
  return {
    id: user.id,
    username: user.username,
    email: user.email,
    avatarUrl: user.avatarUrl ?? null,
    role: user.role,
  };
}

module.exports = {
  mapMeRequestToUserId,
  mapMeResultToResponse,
};
