Skip to content

Commit

Permalink
created model for expenses and userBalance
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiraj-ku committed Sep 17, 2024
1 parent f7706fd commit 3a39735
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Empty file.
20 changes: 20 additions & 0 deletions src/models/expenseModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const mongoose = require("mongoose");

const expenseSchema = new mongoose.Schema({
groupID: String,
payer: String,
description: String,
amount: Number,
participants: [String],
exclude_member: [String],
created_at: { type: Date, default: Date.now() },
});

const userBalance = new mongoose.Schema({
userID: String,
groupID: String,
balance: Number,
});

module.exports.Expense = mongoose.model("Expense", expenseSchema);
module.exports.UserBalance = mongoose.model("UserBalance", userBalance);

0 comments on commit 3a39735

Please sign in to comment.