UNPKG

saksh-wallet

Version:

A Node.js library for managing user wallets, including functionalities for crediting, debiting, and converting currencies, as well as retrieving balances and transaction reports.

40 lines (34 loc) 720 B
const mongoose = require('mongoose'); const budgetSchema = new mongoose.Schema({ userId: { type: String, required: true }, category: { type: String, required: true }, amount: { type: Number, required: true }, period: { type: String, enum: ['daily', 'weekly', 'monthly'], required: true }, startDate: { type: Date, required: true }, endDate: { type: Date, required: true }, history: [{ amount: Number, date: Date }] }); const Budget = mongoose.model('Budget', budgetSchema); module.exports = Budget;