Spaces:
Running
Running
feat: implement business date utility and financial reporting system including expense tracking, platform sales, and profit-loss analysis endpoints
ec62259 Download src/models/PlatformSale.js from aliroohan179/face: direct link, hf CLI and curl.
- Browser
- Download file 612 Bytes
-
https://huggingface.co/spaces/aliroohan179/face/resolve/main/src/models/PlatformSale.js
- Command line
-
hf download hf://spaces/aliroohan179/face/src/models/PlatformSale.js
-
curl -L -o PlatformSale.js https://huggingface.co/spaces/aliroohan179/face/resolve/main/src/models/PlatformSale.js
612 Bytes
| const mongoose = require('mongoose'); | |
| const platformSaleSchema = new mongoose.Schema( | |
| { | |
| platform: { type: String, default: 'Foodpanda', trim: true }, // e.g. 'Foodpanda', 'Cheetay', etc. | |
| date: { type: Date, required: true }, | |
| amount: { type: Number, required: true, min: 0 }, | |
| note: { type: String, default: '' }, | |
| createdBy: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true }, | |
| }, | |
| { timestamps: true } | |
| ); | |
| platformSaleSchema.index({ date: -1 }); | |
| platformSaleSchema.index({ platform: 1, date: -1 }); | |
| module.exports = mongoose.model('PlatformSale', platformSaleSchema); | |