Download models/Transaction.js from ismizo/CVBora: direct link, hf CLI and curl.
- Browser
- Download file 606 Bytes
-
https://huggingface.co/spaces/ismizo/CVBora/resolve/main/models/Transaction.js
- Command line
-
hf download hf://spaces/ismizo/CVBora/models/Transaction.js
-
curl -L -o Transaction.js https://huggingface.co/spaces/ismizo/CVBora/resolve/main/models/Transaction.js
606 Bytes
| const mongoose = require('mongoose'); | |
| const TransactionSchema = new mongoose.Schema({ | |
| // We generate a short, unique 12-character ID for ClickPesa | |
| shortReference: { type: String, required: true, unique: true }, | |
| userId: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true }, | |
| amount: Number, | |
| status: { type: String, default: 'pending' }, // pending, successful, failed | |
| isProcessed: { type: Boolean, default: false }, // <--- ADD THIS | |
| createdAt: { type: Date, default: Date.now } | |
| }); | |
| module.exports = mongoose.model('Transaction', TransactionSchema); |