/***
 *
 * @description This model represent the gym services collection schema in mongodb
 * * source : https://mongoosejs.com/docs/guide.html
 */
import mongoose, { Model } from 'mongoose';
import { IExpenseSchema } from '@/types/IDB';
// define the schema
const expenseSchema = new mongoose.Schema<IExpenseSchema>({
    name: String,
    description: String,
    amount: Number,
    addedAt: Number,
}, { timestamps: true });
// export the model
const expenseModel: Model<IExpenseSchema> = mongoose.models.expenses || mongoose.model<IExpenseSchema>('expenses', expenseSchema);
export default expenseModel