From a2e0a65b2599267efe94d665d6305f59b225bbd5 Mon Sep 17 00:00:00 2001 From: Biswa Kalyan Bhuyan Date: Tue, 29 Apr 2025 10:47:43 +0530 Subject: feat: added initlaized the frontend and backend --- backend/src/models/Category.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 backend/src/models/Category.js (limited to 'backend/src/models/Category.js') diff --git a/backend/src/models/Category.js b/backend/src/models/Category.js new file mode 100644 index 0000000..bb28ba3 --- /dev/null +++ b/backend/src/models/Category.js @@ -0,0 +1,34 @@ +const mongoose = require('mongoose'); + +const categorySchema = new mongoose.Schema( + { + name: { + type: String, + required: [true, 'Category name is required'], + trim: true, + unique: true + }, + description: { + type: String, + trim: true + }, + image: { + type: String + }, + active: { + type: Boolean, + default: true + }, + displayOrder: { + type: Number, + default: 0 + } + }, + { + timestamps: true + } +); + +const Category = mongoose.model('Category', categorySchema); + +module.exports = Category; \ No newline at end of file -- cgit v1.2.3-59-g8ed1b