-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.js
46 lines (39 loc) · 902 Bytes
/
functions.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
const store = require('./store');
// Prompt functions
const getTimeOfDay = () => {
let date = new Date();
let hours = date.getHours();
let minutes = date.getMinutes();
let seconds = date.getSeconds();
let timeOfDay = 'AM';
if (hours > 12) {
hours = hours - 12;
timeOfDay = 'PM';
}
return hours + ':' + minutes + ':' + seconds + ' ' + timeOfDay;
};
const getCoffeList = () => {
return store.getMenuAll();
};
const getCoffe = (id) => {
return store.getMenuItem(id);
};
const getMenu = () => {
return store.getMenuAll();
};
const calculator = ({ a, b }) => {
return (parseInt(a) + parseInt(b)).toString();
};
const prepareOrder = (args) => {
//store.addOrder(email, item, ammount);
console.log('ORDER', args);
return 'listo tu orden esta en camino';
};
module.exports = {
getTimeOfDay,
getCoffe,
getCoffeList,
calculator,
getMenu,
prepareOrder,
};