-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanagerView.js
62 lines (59 loc) · 2.57 KB
/
managerView.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var mysql = require('mysql');
var inquirer = require('inquirer');
var AsciiTable = require('ascii-table');
console.log("Manager File Loaded");
function managerPortal(){
inquirer.prompt([
{
type: "list",
message: "Would you like to: ",
choices: ["View Products for Sale",
"View Low Inventory",
"Add to Inventory",
"Add New Product"
],
name: "managerPortalChoice"
}
]).then(function(managerChoice){
if(managerChoice.managerPortalChoice === "View Products for Sale"){
console.log("You would like to see all products for sale");
} else if(managerChoice.managerPortalChoice === "View Low Inventory"){
console.log("View product inventory with count less than 5");
} else if (managerChoice.managerPortalChoice === "Add to Inventory"){
inquirer.prompt([
{
type: "list",
message: "Would you like to add more inventory?",
choices: [
"Yes, I would like to add more inventory",
"No, Return me to main Manager Portal"
],
name: "addInventory"
}
]).then(function(addInventoryResponse){
if(addInventoryResponse === "Yes, I would like to add more inventory"){
console.log("Function to add more inventory will go here")
} else if(addInventoryResponse === "No, Return me to main Manager Portal")
setTimeout(managerPortal, 3500);
})
} else if(managerChoice.managerPortalChoice === "Add New Product"){
inquirer.prompt([
{
type: "list",
message: "Would you like to add a new product?",
choices: [
"Yes, I would like to add a new product",
"No, Return me to main Manager Portal"
],
name: "addInventory"
}
]).then(function(addProductResponse){
if(addProductResponse === "Yes, I would like to add a new product"){
console.log("Function to add a new product will go here")
} else if(addInventoryResponse === "No, Return me to main Manager Portal")
setTimeout(managerPortal, 3500);
})
}
})
}
module.exports = managerPortal;