-
Notifications
You must be signed in to change notification settings - Fork 0
/
bamazon.js
43 lines (37 loc) · 1.23 KB
/
bamazon.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
var inquirer = require("inquirer");
var manager = require("./bamazonManager");
var customer = require("./bamazonCustomer");
var supervisor = require("./bamazonSupervisor");
// Prompt for term
function bamazonWelcome(){
inquirer.prompt([
{
type: "list",
name: "userInput",
choices: ["Customer Portal", "Manager Portal", "Supervisor Portal", "EXIT"],
message: "Welcome to Bamazon! How would you like to proceed?"
}
// After the prompt, store the user's response in a variable called location.
]).then(function (action) {
switch (action.userInput) {
case "Customer Portal":
customer.customerPortal();
break;
case "Manager Portal":
manager.managerPortal();
break;
case "Supervisor Portal":
supervisor.supervisorPortal();
break;
case "EXIT":
exitHere();
break;
default:
console.log("An error occurred! Unrecognized input.");
}
});
}
function exitHere() {
return console.log("You have exited the Bamazon Welcome Page. Goodbye.")
};
bamazonWelcome();