| const mongoose = require('mongoose'); | |
| const DealSchema = new mongoose.Schema({ | |
| time: String, | |
| deal: String, | |
| symbol: String, | |
| type: String, | |
| direction: String, | |
| volume: Number, | |
| price: Number, | |
| order: String, | |
| commission: Number, | |
| swap: Number, | |
| profit: Number, | |
| balance: Number, | |
| comment: String, | |
| }); | |
| const ReportSchema = new mongoose.Schema({ | |
| accountId: String, | |
| uploadDate: { type: Date, default: Date.now }, | |
| deals: [DealSchema], // Stores the parsed table data | |
| images: [String], // Stores paths/base64 of uploaded PNGs | |
| }); | |
| module.exports = mongoose.model('Report', ReportSchema); |