Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/kasper9n/cryp. Cryptocurrency portfolio tracker (unfinished)
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546const mongoose = require("mongoose");const Schema = mongoose.Schema;
const transactionSchema = new Schema({ type: String, buy: { amount: String, currency: String }, sell: { amount: String, currency: String }, fee: { amount: String, currency: String }, exchange: String, group: String, note: String, date: String,}, { typeKey: "$Type", _id: false });
const userSchema = new Schema({ displayName: String, googleId: String, profilePictureURL: String, transactions: [transactionSchema],}, { typeKey: "$Type" });
const candlestickSchema = new Schema({ fromSymbol: String, toSymbol: String, date: Date, timeframe: String, open: String, high: String, low: String, close: String,});
module.exports = { User: mongoose.model("User", userSchema), Candlestick: mongoose.model("Candlestick", candlestickSchema),};