|
|
@@ -18,49 +18,49 @@ mongoose.connect(db, {useNewUrlParser: true, useUnifiedTopology: true })
|
|
|
});
|
|
|
|
|
|
|
|
|
-let min = 999999999;
|
|
|
-let max = 10000000000;
|
|
|
-for (i = 0; i < 2; i++) {
|
|
|
- let code = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
|
+// let min = 999999999;
|
|
|
+// let max = 10000000000;
|
|
|
+// for (i = 0; i < 2; i++) {
|
|
|
+// let code = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
|
|
|
|
- const ticke = new Ticket({
|
|
|
- code: code,
|
|
|
- isUsed: false,
|
|
|
- gains: "un menu du jour",
|
|
|
- date_used: new Date(),
|
|
|
- index: 'index',
|
|
|
- isServed: true
|
|
|
- });
|
|
|
+// const ticke = new Ticket({
|
|
|
+// code: code,
|
|
|
+// isUsed: false,
|
|
|
+// gains: "un menu du jour",
|
|
|
+// date_used: new Date(),
|
|
|
+// index: 'index',
|
|
|
+// isServed: true
|
|
|
+// });
|
|
|
|
|
|
- ticke.save();
|
|
|
- }
|
|
|
-const resto = new Restaurant({
|
|
|
- "index": 5,
|
|
|
- "name": "FatBoar 5",
|
|
|
- "adress": "20 Rue Houdart, 95700 Roissy-en-France, France",
|
|
|
- "longitude": 2.515081,
|
|
|
- "latitude": 49.002317
|
|
|
- });
|
|
|
- resto.save();
|
|
|
+// ticke.save();
|
|
|
+// }
|
|
|
+// const resto = new Restaurant({
|
|
|
+// "index": 5,
|
|
|
+// "name": "FatBoar 5",
|
|
|
+// "adress": "20 Rue Houdart, 95700 Roissy-en-France, France",
|
|
|
+// "longitude": 2.515081,
|
|
|
+// "latitude": 49.002317
|
|
|
+// });
|
|
|
+// resto.save();
|
|
|
|
|
|
-const salt = bcrypt.genSaltSync(12);
|
|
|
- password = bcrypt.hashSync('Pass@123', 12);
|
|
|
- console.log('fgfg', password);
|
|
|
-let date = new Date(1997, 1 , 12 , 20, 40);
|
|
|
+// const salt = bcrypt.genSaltSync(12);
|
|
|
+// password = bcrypt.hashSync('Pass@123', 12);
|
|
|
+// console.log('fgfg', password);
|
|
|
+// let date = new Date(1997, 1 , 12 , 20, 40);
|
|
|
|
|
|
- const user = new User({
|
|
|
- firstname: " adrien",
|
|
|
- lastname: "xxxxxxx",
|
|
|
- email: "adrien@hotmail.fr",
|
|
|
- role: 'client',
|
|
|
- birthday: date,
|
|
|
- phonenumber: '0680705876',
|
|
|
- isActive: true,
|
|
|
- password: password
|
|
|
- });
|
|
|
+// const user = new User({
|
|
|
+// firstname: " adrien",
|
|
|
+// lastname: "xxxxxxx",
|
|
|
+// email: "adrien@hotmail.fr",
|
|
|
+// role: 'client',
|
|
|
+// birthday: date,
|
|
|
+// phonenumber: '0680705876',
|
|
|
+// isActive: true,
|
|
|
+// password: password
|
|
|
+// });
|
|
|
|
|
|
|
|
|
- user.save();
|
|
|
+// user.save();
|
|
|
|
|
|
module.exports = mongoose.connection;
|
|
|
|