From 3a397353258811418da9d5e08f7e378e0cd25b89 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 17 Sep 2024 22:37:48 +0530 Subject: [PATCH] created model for expenses and userBalance --- src/controllers/expenseController.js | 0 src/models/expenseModel.js | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/controllers/expenseController.js create mode 100644 src/models/expenseModel.js diff --git a/src/controllers/expenseController.js b/src/controllers/expenseController.js new file mode 100644 index 0000000..e69de29 diff --git a/src/models/expenseModel.js b/src/models/expenseModel.js new file mode 100644 index 0000000..4903d78 --- /dev/null +++ b/src/models/expenseModel.js @@ -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);