/employee-tracker

A command line application using Inquirer and MySql that can be used to manage the information for departments, roles, and employees at a company. InquirerJs npm runs command line prompts and MySQL npm connects to the user's MySQL database and performs queries.

Primary LanguageJavaScript

employee-tracker

Description

This is a command line application that can be used to manage the information for departments, roles, and employees at a company. This application uses InquirerJs npm to run command line prompts and MySQL npm to connect to the user's MySQL database and perform queries.

Functional Elements:

  • When the user runs the application by typing npm start, Inquirer prompts the user to choose an action:
    • View Employees- the user can view a list of all employees, including managers, with the following details:
      • employee id, first name, last name, role/title, department, salary, and manager, if applicable.
    • View Departments- the user can view all departments
    • View Roles- the user can view all roles with the department names listed
    • Add an Employee- the user can add an employee by inputting the employee's first and last name, role ID and the role ID of their manager
    • Add a Role- the user can add a role by inputting the role's
    • Update Employee Role- the user can update an employee's role by selecting the employee from a list and inputting the new role ID
    • Remove an Employee- the user can remove an employee by selecting the employee from a list
    • Remove a Department - the user can remove a department by selecting it from a list
    • Remove a Role - the user can remove a role by selecting it from a list
    • Exit- ends the connection

Issues

  • Add employee function prompts user to enter an integer for role ID and manager's role ID rather than a selectable list. I was unable to figure out the correct combination of joins and selects to get these lists to appear. However, the text for the employee's role title and manager name do appear when the user chooses to view employees after adding.
  • Similarly, the Update employee function prompts the user to input an integer for the employee's new role ID rather than selecting the new role from a list.

Usage

In order to use this application, you must have Node.js installed, as well as the Inquirer package (see links below in Credits). You must also have MySQL downloaded and have the company_db set up and seeded. You must also input your MySQL password into the server.js file.

The following videos shows how a user would invoke the application from the command line, how a user would enter responses to all of the prompts in the application, and it allows the user to manage the following functionalities:

View Employees, Departments, and Roles:

Video1

Add, Update, and Remove Employees:

Video2 Video3

Add and Remove Departments:

Video4

Add and Remove Roles:

Video5 Video6

Technologies Used

License

MIT License

Copyright (c) [2021] [Sue Jin Kim]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.