Moved middleware/ & schemas/ into api/.
This commit is contained in:
14
api/schemas/Attendee.js
Normal file
14
api/schemas/Attendee.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const mongoose = require("mongoose");
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const Attendee = new Schema({
|
||||
name: String,
|
||||
phoneNumber: String,
|
||||
green: Number,
|
||||
blue: Number,
|
||||
red: Number,
|
||||
yellow: Number,
|
||||
winner: Boolean
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Attendee", Attendee);
|
||||
18
api/schemas/Highscore.js
Normal file
18
api/schemas/Highscore.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const mongoose = require("mongoose");
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const Highscore = new Schema({
|
||||
name: String,
|
||||
wins: [
|
||||
{
|
||||
color: String,
|
||||
date: Date,
|
||||
wine: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: "Wine"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Highscore", Highscore);
|
||||
14
api/schemas/PreLotteryWine.js
Normal file
14
api/schemas/PreLotteryWine.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const mongoose = require("mongoose");
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const PreLotteryWine = new Schema({
|
||||
name: String,
|
||||
vivinoLink: String,
|
||||
rating: Number,
|
||||
id: String,
|
||||
image: String,
|
||||
price: String,
|
||||
country: String
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("PreLotteryWine", PreLotteryWine);
|
||||
20
api/schemas/Purchase.js
Normal file
20
api/schemas/Purchase.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const mongoose = require("mongoose");
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const Purchase = new Schema({
|
||||
date: Date,
|
||||
blue: Number,
|
||||
red: Number,
|
||||
yellow: Number,
|
||||
green: Number,
|
||||
bought: Number,
|
||||
stolen: Number,
|
||||
wines: [
|
||||
{
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: "Wine"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Purchase", Purchase);
|
||||
13
api/schemas/RequestedWine.js
Normal file
13
api/schemas/RequestedWine.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const mongoose = require("mongoose");
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const RequestedWine = new Schema({
|
||||
count: Number,
|
||||
wineId: String,
|
||||
wine: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: "Wine"
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("RequestedWine", RequestedWine);
|
||||
13
api/schemas/Subscription.js
Normal file
13
api/schemas/Subscription.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const mongoose = require("mongoose");
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const Subscription = new Schema({
|
||||
endpoint: String,
|
||||
expirationTime: Number,
|
||||
keys: {
|
||||
p256dh: String,
|
||||
auth: String
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Subscription", Subscription);
|
||||
9
api/schemas/User.js
Normal file
9
api/schemas/User.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const mongoose = require("mongoose");
|
||||
const Schema = mongoose.Schema;
|
||||
const passportLocalMongoose = require("passport-local-mongoose");
|
||||
|
||||
const User = new Schema({});
|
||||
|
||||
User.plugin(passportLocalMongoose);
|
||||
|
||||
module.exports = mongoose.model("User", User);
|
||||
18
api/schemas/VirtualWinner.js
Normal file
18
api/schemas/VirtualWinner.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const mongoose = require("mongoose");
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const VirtualWinner = new Schema({
|
||||
name: String,
|
||||
phoneNumber: String,
|
||||
color: String,
|
||||
green: Number,
|
||||
blue: Number,
|
||||
red: Number,
|
||||
yellow: Number,
|
||||
id: String,
|
||||
timestamp_drawn: Number,
|
||||
timestamp_sent: Number,
|
||||
timestamp_limit: Number
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("VirtualWinner", VirtualWinner);
|
||||
15
api/schemas/Wine.js
Normal file
15
api/schemas/Wine.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const mongoose = require("mongoose");
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const Wine = new Schema({
|
||||
name: String,
|
||||
vivinoLink: String,
|
||||
rating: Number,
|
||||
occurences: Number,
|
||||
id: String,
|
||||
image: String,
|
||||
price: String,
|
||||
country: String
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Wine", Wine);
|
||||
Reference in New Issue
Block a user