function User({ id, username, isAdmin: isAdminData } = {}) {
  let _id = id;
  let _username = username;
  let _isAdmin = isAdminData;

  function getId() {
    return _id;
  }

  function setId(id) {
    _id = id;
  }

  function getUsername() {
    return _username;
  }

  function setUsername(username) {
    _username = username;
  }

  function isAdmin() {
    return _isAdmin;
  }

  function setAdmin(isAdmin) {
    _isAdmin = isAdmin;
  }

  return {
    getId,
    setId,
    getUsername,
    setUsername,
    isAdmin,
    setAdmin,
  };
}

export default User;
